Skip to content

object-name: detect and report empty reflogs

Patrick Steinhardt requested to merge pks-show-branch-segfault into master

This patch series addresses some shortcomings when parsing ref@{n} syntax via read_ref_at() when the reflog is missing or empty:

  • First, as reported by Yasushi, git-show-branch(1) would segfault because the function does not report when the 0th entry wasn't found.

  • Second, ref@{0} would fall back to return the object ID of ref itself in case the reflog is empty or missing. This behaviour is quite confusing and only works by chance.

The series addresses both of these issues by detecting and reporting the case where the reflog is empty or missing.

Merge request reports