mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'kn/for-each-branch'
Using the timestamp based criteria in "git branch --sort" did not tiebreak branches that point at commits with the same timestamp (or the same commit), making the resulting output unstable. * kn/for-each-branch: ref-filter: fallback on alphabetical comparison
This commit is contained in:
commit
415095f055
|
@ -1457,7 +1457,7 @@ static int cmp_ref_sorting(struct ref_sorting *s, struct ref_array_item *a, stru
|
|||
if (va->ul < vb->ul)
|
||||
cmp = -1;
|
||||
else if (va->ul == vb->ul)
|
||||
cmp = 0;
|
||||
cmp = strcmp(a->refname, b->refname);
|
||||
else
|
||||
cmp = 1;
|
||||
}
|
||||
|
|
|
@ -158,8 +158,8 @@ EOF
|
|||
|
||||
test_expect_success 'git branch `--sort` option' '
|
||||
cat >expect <<-\EOF &&
|
||||
branch-two
|
||||
* (HEAD detached from fromtag)
|
||||
branch-two
|
||||
branch-one
|
||||
master
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue