summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-03 22:16:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-03 22:16:04 (GMT)
commitc167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a (patch)
tree9cd4964f51f8c32133d5e5cce34bedd86e11ee4d /diff-no-index.c
parent465c30a9c6f68c3bac25cd875624286baa37b41c (diff)
parenta97262c62f1a31fcc7edf7629d313058bc7d66b5 (diff)
downloadgit-c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a.zip
git-c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a.tar.gz
git-c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a.tar.bz2
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 8e0fd27..03daadb 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;