X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3700-add.sh;h=874b3a6444ac64182eecf2b6aca4411fc90097e2;hb=3ff999e16bd12f10a2bd5ee464ba8b5f1725866d;hp=575d9508a09911f9d95dad2786fb2f1494abc093;hpb=9b0b0b4f45bc3d2f12391fe0dd4eaef81db97295;p=git.git diff --git a/t/t3700-add.sh b/t/t3700-add.sh index 575d9508a..874b3a644 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -179,6 +179,21 @@ test_expect_success 'git add --refresh' ' test -z "`git diff-index HEAD -- foo`" ' +test_expect_success 'git add --refresh with pathspec' ' + git reset --hard && + echo >foo && echo >bar && echo >baz && + git add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo && + echo "100644 $H 3 foo" | git update-index --index-info && + test-chmtime -60 bar baz && + >expect && + git add --refresh bar >actual && + test_cmp expect actual && + + git diff-files --name-only >actual && + ! grep bar actual&& + grep baz actual +' + test_expect_success POSIXPERM,SANITY 'git add should fail atomically upon an unreadable file' ' git reset --hard && date >foo1 &&