diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-05 14:54:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-05 14:54:15 -0800 |
commit | 02dab5d399fb276f91646d7780da90596bffefab (patch) | |
tree | 29b03cb0e3c0a2111307903c4cf1ba9d895c25d3 /diff-no-index.c | |
parent | 6a65bdcc8c610b31fff6a171e6f49045c3980027 (diff) | |
parent | a97262c62f1a31fcc7edf7629d313058bc7d66b5 (diff) | |
download | git-02dab5d399fb276f91646d7780da90596bffefab.tar.gz |
Merge branch 'nd/diff-with-path-params' into maint
A few options of "git diff" did not work well when the command was
run from a subdirectory.
* nd/diff-with-path-params:
diff: make -O and --output work in subdirectory
diff-no-index: do not take a redundant prefix argument
Diffstat (limited to 'diff-no-index.c')
-rw-r--r-- | diff-no-index.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/diff-no-index.c b/diff-no-index.c index 8e0fd270b5..03daadb25a 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -237,12 +237,12 @@ static void fixup_paths(const char **path, struct strbuf *replacement) } void diff_no_index(struct rev_info *revs, - int argc, const char **argv, - const char *prefix) + int argc, const char **argv) { int i, prefixlen; const char *paths[2]; struct strbuf replacement = STRBUF_INIT; + const char *prefix = revs->prefix; diff_setup(&revs->diffopt); for (i = 1; i < argc - 2; ) { @@ -252,7 +252,8 @@ void diff_no_index(struct rev_info *revs, else if (!strcmp(argv[i], "--")) i++; else { - j = diff_opt_parse(&revs->diffopt, argv + i, argc - i); + j = diff_opt_parse(&revs->diffopt, argv + i, argc - i, + revs->prefix); if (j <= 0) die("invalid diff option/value: %s", argv[i]); i += j; |