diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:04 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-03 14:16:04 -0800 |
commit | c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a (patch) | |
tree | 9cd4964f51f8c32133d5e5cce34bedd86e11ee4d /diff-no-index.c | |
parent | 465c30a9c6f68c3bac25cd875624286baa37b41c (diff) | |
parent | a97262c62f1a31fcc7edf7629d313058bc7d66b5 (diff) | |
download | git-c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a.tar.gz |
Merge branch 'nd/diff-with-path-params'
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; |