diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-28 01:26:37 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-28 01:26:37 +0300 |
commit | d6966f6fffc69e38dc78f3b2b199e4c8def69b3e (patch) | |
tree | c202966598876de8f6b983d1c197beb013fb636d /t | |
parent | 9562f19026f1dcdfcfda86c2c9b7cff21c8b0642 (diff) | |
parent | 68cbb20e737218bcd067bb5b5be658378095d0ed (diff) |
Merge branch 'jc/parse-options-show-branch'
Command line parser fixes.
* jc/parse-options-show-branch:
show-branch: reject --[no-](topo|date)-order
show-branch: --no-sparse should give dense output
Diffstat (limited to 't')
-rwxr-xr-x | t/t3202-show-branch.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh index be20ebe1d5..b17f388f56 100755 --- a/t/t3202-show-branch.sh +++ b/t/t3202-show-branch.sh @@ -119,6 +119,22 @@ test_expect_success 'show branch --remotes' ' test_must_be_empty actual.out ' +test_expect_success 'show-branch --sparse' ' + test_when_finished "git checkout branch10 && git branch -D branchA" && + git checkout -b branchA branch10 && + git merge -s ours -m "merge 1 and 10 to make A" branch1 && + git commit --allow-empty -m "another" && + + git show-branch --sparse >out && + grep "merge 1 and 10 to make A" out && + + git show-branch >out && + ! grep "merge 1 and 10 to make A" out && + + git show-branch --no-sparse >out && + ! grep "merge 1 and 10 to make A" out +' + test_expect_success 'setup show branch --list' ' sed "s/^> //" >expect <<-\EOF > [branch1] branch1 @@ -197,6 +213,15 @@ done <<\EOF --reflog --current EOF +# unnegatable options +for opt in topo-order date-order reflog +do + test_expect_success "show-branch --no-$opt (should fail)" ' + test_must_fail git show-branch --no-$opt 2>err && + grep "unknown option .no-$opt." err + ' +done + test_expect_success 'error descriptions on non-existent branch' ' cat >expect <<-EOF && error: No branch named '\''non-existent'\'.' |