From e5f7a5d16f2c890e7dda96e5681ee8f6687b45e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 20 Jan 2016 18:06:02 +0700 Subject: diff-no-index: do not take a redundant prefix argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prefix is already set up in "revs". The same prefix should be used for all options parsing. So kill the last argument. This patch does not actually change anything because the only caller does use the same prefix for init_revisions() and diff_no_index(). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff-no-index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index 0320605a8..8edc6f369 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -239,12 +239,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; ) { -- cgit v1.2.1 From a97262c62f1a31fcc7edf7629d313058bc7d66b5 Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Thu, 21 Jan 2016 18:48:44 +0700 Subject: diff: make -O and --output work in subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff-no-index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index 8edc6f369..95057b7a7 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -254,7 +254,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; -- cgit v1.2.1