summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e4f614)
raw | patch | inline | side by side (parent: 5e4f614)
author | Stephen Boyd <bebarino@gmail.com> | |
Wed, 24 Mar 2010 07:15:58 +0000 (00:15 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 25 Mar 2010 02:39:40 +0000 (19:39 -0700) |
When FETCH_HEAD contains only 'not-for-merge' entries fmt-merge-msg
still outputs "Merge" (and if the branch isn't master " into <branch>").
In this case fmt-merge-msg is outputting junk and should really just
be quiet. Fix it.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
still outputs "Merge" (and if the branch isn't master " into <branch>").
In this case fmt-merge-msg is outputting junk and should really just
be quiet. Fix it.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fmt-merge-msg.c | patch | blob | history | |
t/t6200-fmt-merge-msg.sh | patch | blob | history |
index 9d524000b5ba4d9c7566edd5756b68d728ec362b..9bb26255e0da1c56dd8caf85b8022ff426f9152f 100644 (file)
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
die ("Error in line %d: %.*s", i, len, p);
}
+ if (!srcs.nr)
+ return 0;
+
strbuf_addstr(out, "Merge ");
for (i = 0; i < srcs.nr; i++) {
struct src_data *src_data = srcs.payload[i];
index 42f6fff373ba9707216279011b112c6c59af8780..ade209af438d25971497ef94bfd886e28b024c54 100755 (executable)
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
setdate &&
git commit -m "Initial" &&
+ git clone . remote &&
+
echo uno >one &&
echo dos >two &&
git add two &&
test_cmp expected actual
'
+test_expect_success 'merge-msg with nothing to merge' '
+
+ git config --unset-all merge.log
+ git config --unset-all merge.summary
+ git config merge.summary yes &&
+
+ (
+ cd remote &&
+ git checkout -b unrelated &&
+ setdate &&
+ git fetch origin &&
+ git fmt-merge-msg <.git/FETCH_HEAD >../actual
+ ) &&
+
+ test_cmp /dev/null actual
+'
+
test_done