Skip to content

Commit

Permalink
Fix ordering of branches in "all branches": Local ones first, even if…
Browse files Browse the repository at this point in the history
… they contain a / slash
  • Loading branch information
phil294 committed Oct 20, 2024
1 parent e899469 commit eac3404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/utils/log-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit eac3404

Please sign in to comment.