]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: tighten label lookups
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 10 Nov 2022 16:43:41 +0000 (16:43 +0000)
committerTaylor Blau <me@ttaylorr.com>
Fri, 11 Nov 2022 04:36:24 +0000 (23:36 -0500)
commit688d82f254f8fc5da019fc4962e6e8646767aba0
treefed6e9326641804646a044c5a59a9fe59ddda03e
parent82766b29611aea7c3fb42a99debfba1436852d38
sequencer: tighten label lookups

The `label` command creates a ref refs/rewritten/<label> that the
`reset` and `merge` commands resolve by calling lookup_label(). That
uses lookup_commit_reference_by_name() to look up the label ref. As
lookup_commit_reference_by_name() uses the dwim rules when looking up
the label it will look for a branch named
refs/heads/refs/rewritten/<label> and return that instead of an error if
the branch exists and the label does not. Fix this by using read_ref()
followed by lookup_commit_object() when looking up labels.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
sequencer.c
t/t3430-rebase-merges.sh