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)
|
if (va->ul < vb->ul)
|
||||||
cmp = -1;
|
cmp = -1;
|
||||||
else if (va->ul == vb->ul)
|
else if (va->ul == vb->ul)
|
||||||
cmp = 0;
|
cmp = strcmp(a->refname, b->refname);
|
||||||
else
|
else
|
||||||
cmp = 1;
|
cmp = 1;
|
||||||
}
|
}
|
||||||
|
@ -158,8 +158,8 @@ EOF
|
|||||||
|
|
||||||
test_expect_success 'git branch `--sort` option' '
|
test_expect_success 'git branch `--sort` option' '
|
||||||
cat >expect <<-\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
branch-two
|
|
||||||
* (HEAD detached from fromtag)
|
* (HEAD detached from fromtag)
|
||||||
|
branch-two
|
||||||
branch-one
|
branch-one
|
||||||
master
|
master
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user