aboutsummaryrefslogtreecommitdiff
path: root/builtin/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-28 19:16:54 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-28 19:16:54 -0700
commit3adc4ec7b9e1d2118501728a75a5b93d971974fa (patch)
tree807d65746060e9967d6d016b230730ef5fd24334 /builtin/rerere.c
parentbe08dee9738eaaa0423885ed189c2b6ad8368cf0 (diff)
parent24358560c3c0ab51c9ef8178d99f46711716f6c0 (diff)
downloadgit-3adc4ec7b9e1d2118501728a75a5b93d971974fa.tar.gz
git-3adc4ec7b9e1d2118501728a75a5b93d971974fa.tar.xz
Sync with v2.5.4
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 12535c9b4..88e1359eb 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 char *name = (const char *)merge_rr.items[i].util;
- diff_two(rerere_path(name, "preimage"), path, path, path);
+ if (diff_two(rerere_path(name, "preimage"), path, path, path))
+ die("unable to generate diff for %s", name);
}
} else
usage_with_options(rerere_usage, options);