Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-30 22:04:08 +0400
committerJunio C Hamano <gitster@pobox.com>2012-03-30 22:07:43 +0400
commitc65dc351f0ae184f69cbc0b6555ff19aacb70e01 (patch)
tree7c4b39cd5f460aedf8bc88e8cdb8061c8aa78e7f /t/t7501-commit.sh
parent828ea97de486c1693d6e4f2c7347acb50235a85d (diff)
t7501: test the right kind of breakage
These tests try to run "git commit" with various "forbidden" combinations of options and expect the command to fail, but they do so without having any change added to the index. We wouldn't be able to catch breakages that would allow these combinations by mistake with them because the command will fail with "nothing to commit" anyway. Make sure we have something added to the index before running the command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 8bb38337a9..45446b186e 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -30,10 +30,12 @@ test_expect_success 'setup: initial commit' '
'
test_expect_success '-m and -F do not mix' '
+ git checkout HEAD file && echo >>file && git add file &&
test_must_fail git commit -m foo -m bar -F file
'
test_expect_success '-m and -C do not mix' '
+ git checkout HEAD file && echo >>file && git add file &&
test_must_fail git commit -C HEAD -m illegal
'