summaryrefslogtreecommitdiff
path: root/builtin/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-05 19:46:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-05 20:20:08 (GMT)
commit590f6e4235a7d44ad39511186ca8bbac02ae8c2e (patch)
tree6999a9512d87bbc06dfb3308fdc824e5226e7597 /builtin/rerere.c
parente13d854322ad802213aea13409505c765b5c68d1 (diff)
parent22f698cb188243b313e024d618283e0293e37140 (diff)
downloadgit-590f6e4235a7d44ad39511186ca8bbac02ae8c2e.zip
git-590f6e4235a7d44ad39511186ca8bbac02ae8c2e.tar.gz
git-590f6e4235a7d44ad39511186ca8bbac02ae8c2e.tar.bz2
Sync with 2.6.1
Diffstat (limited to 'builtin/rerere.c')
-rw-r--r--builtin/rerere.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 8c6cb6c..1bf7242 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -29,9 +29,10 @@ static int diff_two(const char *file1, const char *label1,
xdemitconf_t xecfg;
xdemitcb_t ecb;
mmfile_t minus, plus;
+ int ret;
if (read_mmfile(&minus, file1) || read_mmfile(&plus, file2))
- return 1;
+ return -1;
printf("--- a/%s\n+++ b/%s\n", label1, label2);
fflush(stdout);
@@ -40,11 +41,11 @@ static int diff_two(const char *file1, const char *label1,
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
ecb.outf = outf;
- xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
+ ret = xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
free(minus.ptr);
free(plus.ptr);
- return 0;
+ return ret;
}
int cmd_rerere(int argc, const char **argv, const char *prefix)
@@ -104,7 +105,8 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
for (i = 0; i < merge_rr.nr; i++) {
const char *path = merge_rr.items[i].string;
const struct rerere_id *id = merge_rr.items[i].util;
- diff_two(rerere_path(id, "preimage"), path, path, path);
+ if (diff_two(rerere_path(id, "preimage"), path, path, path))
+ die("unable to generate diff for %s", rerere_path(id, NULL));
}
} else
usage_with_options(rerere_usage, options);