diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2021-04-27 21:17:46 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-28 07:47:19 (GMT) |
commit | 94389e7c81d47102f061b36a93e050d639fe3d40 (patch) | |
tree | ee0d60084033a1297c58fa48ed30584f8f473369 /contrib/subtree/git-subtree.sh | |
parent | cb6551447b8e0c35408b766ad605ba357f720a0d (diff) | |
download | git-94389e7c81d47102f061b36a93e050d639fe3d40.zip git-94389e7c81d47102f061b36a93e050d639fe3d40.tar.gz git-94389e7c81d47102f061b36a93e050d639fe3d40.tar.bz2 |
subtree: allow 'split' flags to be passed to 'push'
'push' does a 'split' internally, but it doesn't pass flags through to the
'split'. This is silly, if you need to pass flags to 'split', then it
means that you can't use 'push'!
So, have 'push' accept 'split' flags, and pass them through to 'split'.
Add tests for this by copying split's tests with minimal modification.
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/subtree/git-subtree.sh')
-rwxr-xr-x | contrib/subtree/git-subtree.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 25d69d7..431214a 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -33,13 +33,13 @@ h,help show the help q quiet d show debug messages P,prefix= the name of the subdir to split out - options for 'split' + options for 'split' (also: 'push') annotate= add a prefix to commit message of new commits b,branch= create a new branch from the split subtree ignore-joins ignore prior --rejoin commits onto= try connecting new tree to an existing one rejoin merge the new branch back into HEAD - options for 'add' and 'merge' (also: 'pull' and 'split --rejoin') + options for 'add' and 'merge' (also: 'pull', 'split --rejoin', and 'push --rejoin') squash merge subtree changes as a single commit m,message= use the given message as the commit message for the merge commit " @@ -964,7 +964,7 @@ cmd_push () { repository=$1 refspec=$2 echo "git push using: " "$repository" "$refspec" - localrev=$(git subtree split --prefix="$arg_prefix") || die + localrev=$(cmd_split) || die git push "$repository" "$localrev":"refs/heads/$refspec" else die "'$dir' must already exist. Try 'git subtree add'." |