Skip to content

Commit feffa04

Browse files
committed
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
2 parents 31d176d + 3212d56 commit feffa04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,8 @@ cmd_push()
715715
repository=$1
716716
refspec=$2
717717
echo "git push using: " $repository $refspec
718-
git push $repository $(git subtree split --prefix=$prefix):refs/heads/$refspec
718+
localrev=$(git subtree split --prefix="$prefix") || die
719+
git push $repository $localrev:refs/heads/$refspec
719720
else
720721
die "'$dir' must already exist. Try 'git subtree add'."
721722
fi

0 commit comments

Comments
 (0)