Skip to content

Commit 09d9d1a

Browse files
Junio C HamanoLinus Torvalds
authored andcommitted
[PATCH] Remove final newline from the value of xfrm_msg variable.
This change makes the implementation of git-external-diff-script cleaner. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 903d475 commit 09d9d1a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

diff.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void builtin_diff(const char *name_a,
141141
printf("new mode %s\n", temp[1].mode);
142142
}
143143
if (xfrm_msg && xfrm_msg[0])
144-
fputs(xfrm_msg, stdout);
144+
puts(xfrm_msg);
145145

146146
if (strncmp(temp[0].mode, temp[1].mode, 3))
147147
/* we do not run diff between different kind
@@ -622,7 +622,7 @@ static void diff_flush_patch(struct diff_filepair *p)
622622
sprintf(msg_,
623623
"similarity index %d%%\n"
624624
"copy from %s\n"
625-
"copy to %s\n",
625+
"copy to %s",
626626
(int)(0.5 + p->score * 100.0/MAX_SCORE),
627627
p->one->path, p->two->path);
628628
msg = msg_;
@@ -631,7 +631,7 @@ static void diff_flush_patch(struct diff_filepair *p)
631631
sprintf(msg_,
632632
"similarity index %d%%\n"
633633
"rename old %s\n"
634-
"rename new %s\n",
634+
"rename new %s",
635635
(int)(0.5 + p->score * 100.0/MAX_SCORE),
636636
p->one->path, p->two->path);
637637
msg = msg_;

git-external-diff-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ then
5959
echo "new mode $mode2"
6060
if test "$xfrm_msg" != ""
6161
then
62-
echo -n $xfrm_msg
62+
echo "$xfrm_msg"
6363
fi
6464
fi
6565
diff ${GIT_DIFF_OPTS-'-pu'} -L "a/$name1" -L "b/$name2" "$tmp1" "$tmp2"

0 commit comments

Comments
 (0)