diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-10-11 14:24:47 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-10-11 14:24:48 +0900 |
| commit | 159cdabd87ac61081eeb22002780eb28689e19b3 (patch) | |
| tree | 17b370b2b5013f719f92eb3c915ea83b4b3598ae /range-diff.c | |
| parent | Merge branch 'cb/pcre1-cleanup' (diff) | |
| parent | range-diff: internally force `diff.noprefix=true` (diff) | |
| download | git-159cdabd87ac61081eeb22002780eb28689e19b3.tar.gz git-159cdabd87ac61081eeb22002780eb28689e19b3.zip | |
Merge branch 'js/range-diff-noprefix'
"git range-diff" segfaulted when diff.noprefix configuration was
used, as it blindly expected the patch it internally generates to
have the standard a/ and b/ prefixes. The command now forces the
internal patch to be built without any prefix, not to be affected
by any end-user configuration.
* js/range-diff-noprefix:
range-diff: internally force `diff.noprefix=true`
Diffstat (limited to 'range-diff.c')
| -rw-r--r-- | range-diff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/range-diff.c b/range-diff.c index ba1e9a4265..f2fc1e02c2 100644 --- a/range-diff.c +++ b/range-diff.c @@ -52,6 +52,7 @@ static int read_patches(const char *range, struct string_list *list) argv_array_pushl(&cp.args, "log", "--no-color", "-p", "--no-merges", "--reverse", "--date-order", "--decorate=no", + "--no-prefix", /* * Choose indicators that are not used anywhere * else in diffs, but still look reasonable @@ -111,7 +112,7 @@ static int read_patches(const char *range, struct string_list *list) if (!util->diff_offset) util->diff_offset = buf.len; line[len - 1] = '\n'; - len = parse_git_diff_header(&root, &linenr, 1, line, + len = parse_git_diff_header(&root, &linenr, 0, line, len, size, &patch); if (len < 0) die(_("could not parse git header '%.*s'"), (int)len, line); |
