Commit 428649877ce32ed472c8f2981ed805ec682732fd

Stefan Sperling 2021-11-20T11:14:44

fall back to comparison by name when refs have the same timestamp This fixes an issue where some references were missing from lists of references sorted by timestamp.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/reference.c b/lib/reference.c
index f1b5c18..eff4b9a 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -838,6 +838,8 @@ got_ref_cmp_by_commit_timestamp_descending(void *arg, int *cmp,
 		*cmp = 1;
 	else if (ref2->committer_time < ref1->committer_time)
 		*cmp = -1;
+	else
+		return got_ref_cmp_by_name(arg, cmp, ref1, ref2);
 
 	return err;
 }