author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 11 Nov 2010 13:03:22 +0000 (20:03 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 13 Nov 2010 00:00:45 +0000 (16:00 -0800) | ||
commit | 0188f6b3c191eb5277e9ebab3b9079f923dbd283 | |
tree | 43bf4393d395cad5b3ec6f4ba9e6ba064744f3c5 | tree | snapshot |
parent | 60aa9cf8f370b69eb7feaad2e1cbcd04280bc799 | commit | diff |
add: do not rely on dtype being NULL behavior
Commit c84de70 (excluded_1(): support exclude files in index -
2009-08-20) added support for excluded() where dtype can be NULL. It
was designed specifically for index matching because there was no
other way to extract dtype information from index. It did not support
wildcard matching (for example, "a*/" pattern would fail to match).
The code was probably misread when commit 108da0d (git add: Add the
"--ignore-missing" option for the dry run - 2010-07-10) was made
because DT_UNKNOWN happens to be zero (NULL) too.
Do not pass DT_UNKNOWN/NULL to excluded(), instead pass a pointer to a
variable that contains DT_UNKNOWN. The real dtype will be extracted
from worktree by excluded(), as expected.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commit c84de70 (excluded_1(): support exclude files in index -
2009-08-20) added support for excluded() where dtype can be NULL. It
was designed specifically for index matching because there was no
other way to extract dtype information from index. It did not support
wildcard matching (for example, "a*/" pattern would fail to match).
The code was probably misread when commit 108da0d (git add: Add the
"--ignore-missing" option for the dry run - 2010-07-10) was made
because DT_UNKNOWN happens to be zero (NULL) too.
Do not pass DT_UNKNOWN/NULL to excluded(), instead pass a pointer to a
variable that contains DT_UNKNOWN. The real dtype will be extracted
from worktree by excluded(), as expected.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c | diff | blob | history |