From c61eb4106d9ea77ba770c28a018cafa3b81b927e Mon Sep 17 00:00:00 2001 From: Alexey Shumkin Date: Sat, 5 Sep 2015 01:24:10 +0300 Subject: t7900-subtree: test the "space in a subdirectory name" case In common case there can be spaces in a subdirectory name. Change tests accorgingly to this statement. Also, as far as a call to the `rejoin_msg` function (in `cmd_split`) does not take into account such a case this patch fixes commit message when `--rejoin` option is set . Besides, as `fixnl` and `multiline` functions did not take into account the "new" tested "space in a subdirectory name" case they become unused and redundant, so they are removed. Signed-off-by: Alexey Shumkin Signed-off-by: Junio C Hamano --- contrib/subtree/git-subtree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/subtree/git-subtree.sh') diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 9f06571851..72a20c0c2d 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -648,7 +648,7 @@ cmd_split() debug "Merging split branch into HEAD..." latest_old=$(cache_get latest_old) git merge -s ours \ - -m "$(rejoin_msg $dir $latest_old $latest_new)" \ + -m "$(rejoin_msg "$dir" $latest_old $latest_new)" \ $latest_new >&2 || exit $? fi if [ -n "$branch" ]; then -- cgit v1.2.3 From 5b6ab38bd31790d072aabbc23fe936ba5e1b072a Mon Sep 17 00:00:00 2001 From: Alexey Shumkin Date: Sat, 5 Sep 2015 01:24:11 +0300 Subject: contrib/subtree: respect spaces in a repository path Remote repository may have spaces in its path, so take it into account. Also, as far as there are no tests for the `push` command, add them. Signed-off-by: Alexey Shumkin Signed-off-by: Junio C Hamano --- contrib/subtree/git-subtree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/subtree/git-subtree.sh') diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 72a20c0c2d..308b777b0a 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -735,7 +735,7 @@ cmd_push() refspec=$2 echo "git push using: " $repository $refspec localrev=$(git subtree split --prefix="$prefix") || die - git push $repository $localrev:refs/heads/$refspec + git push "$repository" $localrev:refs/heads/$refspec else die "'$dir' must already exist. Try 'git subtree add'." fi -- cgit v1.2.3