aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-12-03 00:38:12 -0800
committerJunio C Hamano <gitster@pobox.com>2008-12-03 00:38:12 -0800
commitae26e7c74970281bd3597c79e44a8b54a927bbe1 (patch)
treeab91c9e9de975fd469f81795a5f53026050b2b71 /t
parent6dbcb59e8271c16cbec486932bd3069279e09c60 (diff)
parent331fcb598ec0127fd89c992361bc573dcd3a4a63 (diff)
downloadgit-ae26e7c74970281bd3597c79e44a8b54a927bbe1.tar.gz
git-ae26e7c74970281bd3597c79e44a8b54a927bbe1.tar.xz
Merge branch 'jc/rm-i-t-a'
* jc/rm-i-t-a: git add --intent-to-add: do not let an empty blob be committed by accident git add --intent-to-add: fix removal of cached emptiness builtin-rm.c: explain and clarify the "local change" logic Extend index to save more flags
Diffstat (limited to 't')
-rwxr-xr-xt/t2203-add-intent.sh28
-rwxr-xr-xt/t3600-rm.sh4
2 files changed, 30 insertions, 2 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index d4de35ea0..58a329961 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -32,5 +32,33 @@ test_expect_success 'intent to add does not clobber existing paths' '
! grep "$empty" actual
'
+test_expect_success 'cannot commit with i-t-a entry' '
+ test_tick &&
+ git commit -a -m initial &&
+ git reset --hard &&
+
+ echo xyzzy >rezrov &&
+ echo frotz >nitfol &&
+ git add rezrov &&
+ git add -N nitfol &&
+ test_must_fail git commit
+'
+
+test_expect_success 'can commit with an unrelated i-t-a entry in index' '
+ git reset --hard &&
+ echo xyzzy >rezrov &&
+ echo frotz >nitfol &&
+ git add rezrov &&
+ git add -N nitfol &&
+ git commit -m partial rezrov
+'
+
+test_expect_success 'can "commit -a" with an i-t-a entry' '
+ git reset --hard &&
+ : >nitfol &&
+ git add -N nitfol &&
+ git commit -a -m all
+'
+
test_done
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 5b4d6f713..b7d46e50a 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -187,8 +187,8 @@ test_expect_success 'but with -f it should work.' '
test_must_fail git ls-files --error-unmatch baz
'
-test_expect_failure 'refuse to remove cached empty file with modifications' '
- touch empty &&
+test_expect_success 'refuse to remove cached empty file with modifications' '
+ >empty &&
git add empty &&
echo content >empty &&
test_must_fail git rm --cached empty