author | Junio C Hamano <gitster@pobox.com> | |
Tue, 27 Sep 2011 23:59:01 +0000 (16:59 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 28 Sep 2011 00:00:06 +0000 (17:00 -0700) | ||
commit | f858c646b5428519c4f847c5f15a9ead72a62b16 | |
tree | 8a8e08bbd6e3ec65531e6e057812d4c60348b0c9 | tree | snapshot |
parent | b04ba2bb42957f63567f530e092385f085b25e63 | commit | diff |
archive.c: use OPT_BOOL()
The list variable (which is OPT_BOOLEAN) is initialized to 0 and only
checked against 0 in the code, so it is safe to use OPT_BOOL().
The worktree_attributes variable (which is OPT_BOOLEAN) is initialized to
0 and later assigned to a field with the same name in struct archive_args,
which is a bitfield of width 1. It is safe and even more correct to use
OPT_BOOL() here; the new test in 5001 demonstrates why using OPT_COUNTUP
is wrong.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The list variable (which is OPT_BOOLEAN) is initialized to 0 and only
checked against 0 in the code, so it is safe to use OPT_BOOL().
The worktree_attributes variable (which is OPT_BOOLEAN) is initialized to
0 and later assigned to a field with the same name in struct archive_args,
which is a bitfield of width 1. It is safe and even more correct to use
OPT_BOOL() here; the new test in 5001 demonstrates why using OPT_COUNTUP
is wrong.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive.c | diff | blob | history | |
t/t5001-archive-attr.sh | diff | blob | history |