aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-05-29 14:29:53 -0700
committerJunio C Hamano <gitster@pobox.com>2013-05-29 14:29:53 -0700
commitfeffa044374c4bfc29b3f2b1bd26551acbffcf40 (patch)
tree19550899503357f02a147c2699c3126a271f2bb0 /contrib
parent31d176d08383012f9cbd040636151e22724b5ee7 (diff)
parent3212d56ce528a86170f7809659f80a8769a5875f (diff)
downloadgit-feffa044374c4bfc29b3f2b1bd26551acbffcf40.tar.gz
git-feffa044374c4bfc29b3f2b1bd26551acbffcf40.tar.xz
Merge branch 'jk/subtree-do-not-push-if-split-fails'
"git subtree" (in contrib/) had one codepath with loose error checks to lose data at the remote side. * jk/subtree-do-not-push-if-split-fails: contrib/subtree: don't delete remote branches if split fails
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/subtree/git-subtree.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 8a23f58ba..10daa8b0e 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -715,7 +715,8 @@ cmd_push()
repository=$1
refspec=$2
echo "git push using: " $repository $refspec
- git push $repository $(git subtree split --prefix=$prefix):refs/heads/$refspec
+ localrev=$(git subtree split --prefix="$prefix") || die
+ git push $repository $localrev:refs/heads/$refspec
else
die "'$dir' must already exist. Try 'git subtree add'."
fi