Skip to content

Commit

Permalink
t3200 (branch): fix '&&' chaining
Browse files Browse the repository at this point in the history
Breaks in a test assertion's && chain can potentially hide failures
from earlier commands in the chain.  Fix these breaks.

The 'git branch --help' in the test may fail if git manual pages are
not installed, but the point of the test is to make sure it does not
create a bogus branch "--help", so run it under 'test_might_fail'.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Dec 9, 2011
1 parent 4cb5d10 commit 2f13904
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t3200-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test_expect_success \

test_expect_success \
'git branch --help should not have created a bogus branch' '
git branch --help </dev/null >/dev/null 2>/dev/null;
test_might_fail git branch --help </dev/null >/dev/null 2>/dev/null &&
test_path_is_missing .git/refs/heads/--help
'

Expand Down Expand Up @@ -88,7 +88,7 @@ test_expect_success \
test_expect_success \
'git branch -m n/n n should work' \
'git branch -l n/n &&
git branch -m n/n n
git branch -m n/n n &&
test_path_is_file .git/logs/refs/heads/n'

test_expect_success 'git branch -m o/o o should fail when o/p exists' '
Expand Down

0 comments on commit 2f13904

Please sign in to comment.