summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac78b00)
raw | patch | inline | side by side (parent: ac78b00)
author | Pauli Virtanen <pav@iki.fi> | |
Sat, 10 Oct 2009 15:51:45 +0000 (18:51 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 10 Oct 2009 21:56:13 +0000 (14:56 -0700) |
Make "git add -p" to not skip files that are in index even if they are
excluded (by .gitignore etc.). This fixes the contradictory behavior
that "git status" and "git commit -a" listed such files as modified, but
"git add -p FILENAME" ignored them.
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
excluded (by .gitignore etc.). This fixes the contradictory behavior
that "git status" and "git commit -a" listed such files as modified, but
"git add -p FILENAME" ignored them.
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-add--interactive.perl | patch | blob | history | |
t/t3701-add-interactive.sh | patch | blob | history |
index 06f70602cc619e9e13bdc609a43780ce8bc6570d..3e90d716fa1f0b1513cc0639524dbd865bbf9961 100755 (executable)
@tracked = map {
chomp $_;
unquote_path($_);
- } run_cmd_pipe(qw(git ls-files --exclude-standard --), @ARGV);
+ } run_cmd_pipe(qw(git ls-files --), @ARGV);
return if (!@tracked);
}
index 62fd65e18d434711176ddb1c22ef057b879e992a..687bd7ab53397d3bc9d5150bc7cd290efa8ebdbc 100755 (executable)
test_cmp expected output
'
+test_expect_success 'skip files similarly as commit -a' '
+ git reset &&
+ echo file >.gitignore &&
+ echo changed >file &&
+ echo y | git add -p file &&
+ git diff >output &&
+ git reset &&
+ git commit -am commit &&
+ git diff >expected &&
+ test_cmp expected output &&
+ git reset --hard HEAD^
+'
+rm -f .gitignore
+
if test "$(git config --bool core.filemode)" = false
then
say 'skipping filemode tests (filesystem does not properly support modes)'