[PATCH 06/12] Remove final newline from the value of xfrm_msg variable.
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:58
Subsystem:
the rest · Maintainer:
Linus Torvalds
This change makes the implementation of git-external-diff-script cleaner. Signed-off-by: Junio C Hamano <redacted> --- diff.c | 6 +++--- git-external-diff-script | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c@@ -141,7 +141,7 @@ static void builtin_diff(const char *nam printf("new mode %s\n", temp[1].mode); } if (xfrm_msg && xfrm_msg[0]) - fputs(xfrm_msg, stdout); + puts(xfrm_msg); if (strncmp(temp[0].mode, temp[1].mode, 3)) /* we do not run diff between different kind
@@ -622,7 +622,7 @@ static void diff_flush_patch(struct diff sprintf(msg_, "similarity index %d%%\n" "copy from %s\n" - "copy to %s\n", + "copy to %s", (int)(0.5 + p->score * 100.0/MAX_SCORE), p->one->path, p->two->path); msg = msg_;
@@ -631,7 +631,7 @@ static void diff_flush_patch(struct diff sprintf(msg_, "similarity index %d%%\n" "rename old %s\n" - "rename new %s\n", + "rename new %s", (int)(0.5 + p->score * 100.0/MAX_SCORE), p->one->path, p->two->path); msg = msg_;
diff --git a/git-external-diff-script b/git-external-diff-script
--- a/git-external-diff-script
+++ b/git-external-diff-script@@ -59,7 +59,7 @@ then echo "new mode $mode2" if test "$xfrm_msg" != "" then - echo -n $xfrm_msg + echo "$xfrm_msg" fi fi diff ${GIT_DIFF_OPTS-'-pu'} -L "a/$name1" -L "b/$name2" "$tmp1" "$tmp2" ------------------------------------------------