summaryrefslogtreecommitdiff
path: root/t/t3701-add-interactive.sh
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2009-10-10 18:51:45 +0300
committerJunio C Hamano <gitster@pobox.com>2009-10-10 14:56:13 -0700
commitb145b211baa4129a827cc1b1b1a7984523b8f903 (patch)
treea8c0f81923c408dc247f42c96e254cf4a6f34649 /t/t3701-add-interactive.sh
parentac78b009398f8cab1f57d1ef62db21ac95e11ed1 (diff)
downloadgit-b145b211baa4129a827cc1b1b1a7984523b8f903.tar.gz
git-add--interactive: never skip files included in index
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>
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 62fd65e18d..687bd7ab53 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -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)'