]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t3700-add.sh
t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
[git.git] / t / t3700-add.sh
index fe93ce52e7a8a42fd7f7cfe82bbadf39e1a7d96e..525c9a8fdfb4953612e6946994c8e555f676bfd2 100755 (executable)
@@ -243,4 +243,21 @@ test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
        ! ( git ls-files foobar | grep foobar )
 '
 
+test_expect_success 'git add to resolve conflicts on otherwise ignored path' '
+       git reset --hard &&
+       H=$(git rev-parse :1/2/a) &&
+       (
+               echo "100644 $H 1       track-this"
+               echo "100644 $H 3       track-this"
+       ) | git update-index --index-info &&
+       echo track-this >>.gitignore &&
+       echo resolved >track-this &&
+       git add track-this
+'
+
+test_expect_success '"add non-existent" should fail' '
+       test_must_fail git add non-existent &&
+       ! (git ls-files | grep "non-existent")
+'
+
 test_done