-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sort_in_topological_order(): avoid setting a commit flag
We used to set the TOPOSORT flag of commits during the topological sorting, but we can just as well use the member "indegree" for it: indegree is now incremented by 1 in the cases where the commit used to have the TOPOSORT flag. This is the same behavior as before, since indegree could not be non-zero when TOPOSORT was unset. Incidentally, this fixes the bug in show-branch where the 8th column was not shown: show-branch sorts the commits in topological order, assuming that all the commit flags are available for show-branch's private matters. But this was not true: TOPOSORT was identical to the flag corresponding to the 8th ref. So the flags for the 8th column were unset by the topological sorting. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Johannes Schindelin
authored and
Junio C Hamano
committed
Aug 2, 2008
1 parent
b1264da
commit 11ee57b
Showing
3 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/sh | ||
|
||
test_description='test show-branch with more than 8 heads' | ||
|
||
. ./test-lib.sh | ||
|
||
numbers="1 2 3 4 5 6 7 8 9 10" | ||
|
||
test_expect_success 'setup' ' | ||
> file && | ||
git add file && | ||
test_tick && | ||
git commit -m initial && | ||
for i in $numbers | ||
do | ||
git checkout -b branch$i master && | ||
> file$i && | ||
git add file$i && | ||
test_tick && | ||
git commit -m branch$i || break | ||
done | ||
' | ||
|
||
cat > expect << EOF | ||
! [branch1] branch1 | ||
! [branch2] branch2 | ||
! [branch3] branch3 | ||
! [branch4] branch4 | ||
! [branch5] branch5 | ||
! [branch6] branch6 | ||
! [branch7] branch7 | ||
! [branch8] branch8 | ||
! [branch9] branch9 | ||
* [branch10] branch10 | ||
---------- | ||
* [branch10] branch10 | ||
+ [branch9] branch9 | ||
+ [branch8] branch8 | ||
+ [branch7] branch7 | ||
+ [branch6] branch6 | ||
+ [branch5] branch5 | ||
+ [branch4] branch4 | ||
+ [branch3] branch3 | ||
+ [branch2] branch2 | ||
+ [branch1] branch1 | ||
+++++++++* [branch10^] initial | ||
EOF | ||
|
||
test_expect_success 'show-branch with more than 8 branches' ' | ||
git show-branch $(for i in $numbers; do echo branch$i; done) > out && | ||
test_cmp expect out | ||
' | ||
|
||
test_done |