Cloning from a repo without "current branch"
[gitweb.git] / git-merge.sh
index 44e9b70a6550f11e3bbf5dcf7f71d76a4c1bcd07..981d69d35f4e6349d99192996af3b793071a6172 100755 (executable)
@@ -335,7 +335,7 @@ f,*)
                then
                        echo "Wonderful."
                        result_commit=$(
-                               echo "$merge_msg" |
+                               printf '%s\n' "$merge_msg" |
                                git-commit-tree $result_tree -p HEAD -p "$1"
                        ) || exit
                        finish "$result_commit" "In-index merge"
@@ -440,7 +440,7 @@ done
 if test '' != "$result_tree"
 then
     parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
-    result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
+    result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit
     finish "$result_commit" "Merge made by $wt_strategy."
     dropsave
     exit 0
@@ -479,7 +479,7 @@ else
        do
                echo $remote
        done >"$GIT_DIR/MERGE_HEAD"
-       echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
+       printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG"
 fi
 
 if test "$merge_was_ok" = t