]> Kevux Git Server - rit/commit
symlinks: use unsigned int for flags
authorTian Yuchen <a3205153416@gmail.com>
Mon, 16 Feb 2026 17:20:28 +0000 (01:20 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Feb 2026 23:03:42 +0000 (15:03 -0800)
commit96286f14b0dc1a1c9ba4f6842d99ce738cc766da
tree66202fb971f5e880e9f51b1565dc98108c0a11ac
parent83a69f19359e6d9bc980563caca38b2b5729808c
symlinks: use unsigned int for flags

The 'flags' and 'track_flags' fields in symlinks.c are used
strictly as a collection of bits (using bitwise operators including
&, |, ~). Using a signed integer for bitmasks may lead to undefined
behavior with shift operations and logic errors if the MSB is touched.

Change these fields from 'int' to 'unsigned int' to match our usage
patterns.

Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
symlinks.c
symlinks.h