From eac3404e8ba339d83aebdc89b4992ab1bc01458c Mon Sep 17 00:00:00 2001 From: Philip Waritschlager Date: Sun, 20 Oct 2024 20:56:49 +0200 Subject: [PATCH] Fix ordering of branches in "all branches": Local ones first, even if they contain a / slash --- web/src/utils/log-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/utils/log-parser.js b/web/src/utils/log-parser.js index 01347bc..f4b428a 100644 --- a/web/src/utils/log-parser.js +++ b/web/src/utils/log-parser.js @@ -14,7 +14,7 @@ function git_ref_sort(/** @type {GitRef} */ a, /** @type {GitRef} */ b) { // prefer branch over tag/stash // prefer tag over stash // prefer local branch over remote branch - return Number(a_is_tag || ! a.id.startsWith('refs/')) - Number(b_is_tag || ! b.id.startsWith('refs/')) || Number(b_is_tag) - Number(a_is_tag) || a.id.indexOf('/') - b.id.indexOf('/') + return Number(a_is_tag || ! a.id.startsWith('refs/')) - Number(b_is_tag || ! b.id.startsWith('refs/')) || Number(b_is_tag) - Number(a_is_tag) || Number(Boolean(/** @type {Branch} */ (a).remote_name)) - Number(Boolean(/** @type {Branch} */ (b).remote_name)) // eslint-disable-line @stylistic/no-extra-parens } /**