summaryrefslogtreecommitdiff
path: root/contrib/subtree/git-subtree.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-01-22 13:08:45 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-01-22 13:08:45 -0800
commita039a79e9d00fed442f31ce69054e98e7dd1fc69 (patch)
tree6b5399f44f47489680658b32925f890362a63300 /contrib/subtree/git-subtree.sh
parentSecond batch for 2.8 cycle (diff)
parentcontrib/subtree: unwrap tag refs (diff)
downloadtgif-a039a79e9d00fed442f31ce69054e98e7dd1fc69.tar.xz
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
Diffstat (limited to 'contrib/subtree/git-subtree.sh')
-rwxr-xr-xcontrib/subtree/git-subtree.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index edf36f8c36..efbdb720e6 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -245,7 +245,10 @@ find_latest_squash()
case "$a" in
START) sq="$b" ;;
git-subtree-mainline:) main="$b" ;;
- git-subtree-split:) sub="$b" ;;
+ git-subtree-split:)
+ sub="$(git rev-parse "$b^0")" ||
+ die "could not rev-parse split hash $b from commit $sq"
+ ;;
END)
if [ -n "$sub" ]; then
if [ -n "$main" ]; then
@@ -278,7 +281,10 @@ find_existing_splits()
case "$a" in
START) sq="$b" ;;
git-subtree-mainline:) main="$b" ;;
- git-subtree-split:) sub="$b" ;;
+ git-subtree-split:)
+ sub="$(git rev-parse "$b^0")" ||
+ die "could not rev-parse split hash $b from commit $sq"
+ ;;
END)
debug " Main is: '$main'"
if [ -z "$main" -a -n "$sub" ]; then