Merge branch 'jk/subtree-do-not-push-if-split-fails' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Jun 2013 21:37:44 +0000 (14:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jun 2013 21:37:44 +0000 (14:37 -0700)
* jk/subtree-do-not-push-if-split-fails:
contrib/subtree: don't delete remote branches if split fails

contrib/subtree/git-subtree.sh
index 8a23f58ba04c4b1402c66d03db69d0c109c90b58..10daa8b0eb3352305347354d09ef443993af7809 100755 (executable)
@@ -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