Skip to content

Commit

Permalink
test for add with non-existent pathspec
Browse files Browse the repository at this point in the history
Add a test for 'git add -u pathspec' and 'git add pathspec' where
pathspec does not exist. The expected result is that git add exits with
an error message and an appropriate exit code.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Chris Packham authored and Junio C Hamano committed Feb 17, 2010
1 parent 81f45e7 commit 1e7ef74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/t2200-add-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,9 @@ test_expect_success 'add -u resolves unmerged paths' '
'

test_expect_success '"add -u non-existent" should fail' '
test_must_fail git add -u non-existent &&
! (git ls-files | grep "non-existent")
'

test_done
5 changes: 5 additions & 0 deletions t/t3700-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,9 @@ test_expect_success 'git add to resolve conflicts on otherwise ignored path' '
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

0 comments on commit 1e7ef74

Please sign in to comment.