Merge branch 'pv/maint-add-p-no-exclude'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 Oct 2009 23:13:20 +0000 (16:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Oct 2009 23:13:20 +0000 (16:13 -0700)
* pv/maint-add-p-no-exclude:
  git-add--interactive: never skip files included in index

git-add--interactive.perl
t/t3701-add-interactive.sh

index 392efb913f7c2ff13bbbb46e4414325b71e07676..69aeaf03ec65922d8a3e5e092fab3d4b6ffcb63e 100755 (executable)
@@ -259,7 +259,7 @@ sub list_modified {
                @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)
@@ -138,6 +138,20 @@ test_expect_success 'real edit works' '
        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)'