diff --git a/ref-filter.c b/ref-filter.c index dbd8fcec24..f9c9d3692c 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1483,7 +1483,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; } diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index f1ae5ff662..2aa199607e 100755 --- a/t/t3203-branch-output.sh +++ b/t/t3203-branch-output.sh @@ -145,8 +145,8 @@ EOF test_expect_success 'git branch `--sort` option' ' cat >expect <<-\EOF && - branch-two * (HEAD detached from fromtag) + branch-two branch-one master EOF