summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-07-27 13:00:26 -0700
committerJunio C Hamano <gitster@pobox.com>2022-07-27 13:00:26 -0700
commit682079fb2a14bae855b1564898237cdebd0e00b2 (patch)
tree0b30538bfa7aa1e56487888efd3186c89575f084
parentc896716d7725c1098940898c13aa1e65337c2a92 (diff)
parentdf534dcbaafa74be9e922418712bede75676588b (diff)
downloadgit-682079fb2a14bae855b1564898237cdebd0e00b2.tar.xz
Merge branch 'js/shortlog-sort-stably' into maint
"git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. source: <pull.1290.git.1657813429221.gitgitgadget@gmail.com> * js/shortlog-sort-stably: shortlog: use a stable sort
-rw-r--r--builtin/shortlog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 35825f075e..086dfee45a 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -443,7 +443,7 @@ void shortlog_output(struct shortlog *log)
struct strbuf sb = STRBUF_INIT;
if (log->sort_by_number)
- QSORT(log->list.items, log->list.nr,
+ STABLE_QSORT(log->list.items, log->list.nr,
log->summary ? compare_by_counter : compare_by_list);
for (i = 0; i < log->list.nr; i++) {
const struct string_list_item *item = &log->list.items[i];