Skip to content

Commit 8c0a546

Browse files
committed
Merge branch 'as/subtree-with-spaces' into maint
Update "git subtree" (in contrib/) so that it can take whitespaces in the pathnames, not only in the in-tree pathname but the name of the directory that the repository is in. * as/subtree-with-spaces: contrib/subtree: respect spaces in a repository path t7900-subtree: test the "space in a subdirectory name" case
2 parents 4cb5488 + 5b6ab38 commit 8c0a546

File tree

2 files changed

+124
-74
lines changed

2 files changed

+124
-74
lines changed

contrib/subtree/git-subtree.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ cmd_split()
648648
debug "Merging split branch into HEAD..."
649649
latest_old=$(cache_get latest_old)
650650
git merge -s ours \
651-
-m "$(rejoin_msg $dir $latest_old $latest_new)" \
651+
-m "$(rejoin_msg "$dir" $latest_old $latest_new)" \
652652
$latest_new >&2 || exit $?
653653
fi
654654
if [ -n "$branch" ]; then
@@ -735,7 +735,7 @@ cmd_push()
735735
refspec=$2
736736
echo "git push using: " $repository $refspec
737737
localrev=$(git subtree split --prefix="$prefix") || die
738-
git push $repository $localrev:refs/heads/$refspec
738+
git push "$repository" $localrev:refs/heads/$refspec
739739
else
740740
die "'$dir' must already exist. Try 'git subtree add'."
741741
fi

0 commit comments

Comments
 (0)