]> git.ipfire.org Git - thirdparty/git.git/commit
gitk: fix error when remote tracking branch is deleted
authorMichael Rappazzo <rappazzo@gmail.com>
Sat, 13 Sep 2025 11:31:51 +0000 (07:31 -0400)
committerJohannes Sixt <j6t@kdbg.org>
Sun, 14 Sep 2025 18:18:30 +0000 (20:18 +0200)
commit88189dd7cb535486b74bcf50997253797f4b999c
treee58b685dda6de820e2610f9b35a8bfd02fe03a25
parent9965cc771b6b43a8852a4950a196180f2c616891
gitk: fix error when remote tracking branch is deleted

When a remote tracking branch is deleted (e.g., via 'git push --delete
origin branch'), the headids array entry for that branch is removed, but
upstreamofref may still reference it. This causes gitk to show an error
and prevents the Tags and Heads view from opening.

Fix by checking that headids($upstreamofref($n)) exists before accessing
it in the refill_reflist function.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
gitk