]> git.ipfire.org Git - thirdparty/git.git/commit
subtree: fix split after annotated tag was squashed merged
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Fri, 21 Oct 2022 15:13:39 +0000 (15:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2022 20:51:06 +0000 (13:51 -0700)
commit1762382ab19dd6d5d84dd32e35e25c2b55b651f0
treef0659e9318d3d2cc671b70a38966495a16bdb084
parent0d330673d4fa9e0bea91092abb657606f4325e7e
subtree: fix split after annotated tag was squashed merged

The previous commit fixed a failure in 'git subtree merge --squash' when
the previous squash-merge merged an annotated tag of the subtree
repository which is missing locally.

The same failure happens in 'git subtree split', either directly or when
called by 'git subtree push', under the same circumstances: 'cmd_split'
invokes 'find_existing_splits', which loops through previous commits and
invokes 'git rev-parse' (via 'process_subtree_split_trailer') on the
value of any 'git subtree-split' trailer it finds. This fails if this
value is the hash of an annotated tag which is missing locally.

Add a new optional argument 'repository' to 'cmd_split' and
'find_existing_splits', and invoke 'cmd_split' with that argument from
'cmd_push'. This allows 'process_subtree_split_trailer' to try to fetch
the missing tag from the 'repository' if it's not available locally,
mirroring the new behaviour of 'git subtree pull' and 'git subtree
merge'.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh
contrib/subtree/git-subtree.txt
contrib/subtree/t/t7900-subtree.sh