diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-05-15 13:11:44 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-05-15 13:46:47 -0700 |
commit | 6c91162449cb0a2fe3c42a1caa232444afed9c7c (patch) | |
tree | 47e96baeae0c1501009605cbd2525c83a02638df /help.c | |
parent | 655268452cafd061c6c38541a719b6f5b9d528e3 (diff) |
fetch: avoid unnecessary work when there is no current branch
As pointed out by CodeQL, `branch_get()` may return `NULL`, in which
case `branch_has_merge_config()` would return early, but we can even
avoid enumerating the refs prefixes in that case, saving even more CPU
cycles.
Technically, we should enclose these two statements in an `if (branch)
{...}` block, but the indentation is already quite deep, therefore I
refrained from doing that.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
0 files changed, 0 insertions, 0 deletions