Skip to content

Commit a039a79

Browse files
committed
Merge branch 'rm/subtree-unwrap-tags'
"git subtree" (in contrib/) records the tag object name in the commit log message when a subtree is added using a tag, without peeling it down to the underlying commit. The tag needs to be peeled when "git subtree split" wants to work on the commit, but the command forgot to do so. * rm/subtree-unwrap-tags: contrib/subtree: unwrap tag refs
2 parents 3ee1e0f + 5d65fe3 commit a039a79

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ find_latest_squash()
245245
case "$a" in
246246
START) sq="$b" ;;
247247
git-subtree-mainline:) main="$b" ;;
248-
git-subtree-split:) sub="$b" ;;
248+
git-subtree-split:)
249+
sub="$(git rev-parse "$b^0")" ||
250+
die "could not rev-parse split hash $b from commit $sq"
251+
;;
249252
END)
250253
if [ -n "$sub" ]; then
251254
if [ -n "$main" ]; then
@@ -278,7 +281,10 @@ find_existing_splits()
278281
case "$a" in
279282
START) sq="$b" ;;
280283
git-subtree-mainline:) main="$b" ;;
281-
git-subtree-split:) sub="$b" ;;
284+
git-subtree-split:)
285+
sub="$(git rev-parse "$b^0")" ||
286+
die "could not rev-parse split hash $b from commit $sq"
287+
;;
282288
END)
283289
debug " Main is: '$main'"
284290
if [ -z "$main" -a -n "$sub" ]; then

0 commit comments

Comments
 (0)