зеркало из https://github.com/microsoft/git.git
diff-ni: allow running from a subdirectory.
When run from a subdirectory of a repository, the command forgot to adjust paths given to it with prefix. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
e551208dea
Коммит
ae792aa52b
12
diff-lib.c
12
diff-lib.c
|
@ -248,6 +248,18 @@ int setup_diff_no_index(struct rev_info *revs,
|
||||||
die("invalid diff option/value: %s", argv[i]);
|
die("invalid diff option/value: %s", argv[i]);
|
||||||
i += j;
|
i += j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (prefix) {
|
||||||
|
int len = strlen(prefix);
|
||||||
|
|
||||||
|
revs->diffopt.paths = xcalloc(2, sizeof(char*));
|
||||||
|
for (i = 0; i < 2; i++) {
|
||||||
|
const char *p;
|
||||||
|
p = prefix_filename(prefix, len, argv[argc - 2 + i]);
|
||||||
|
revs->diffopt.paths[i] = xstrdup(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
revs->diffopt.paths = argv + argc - 2;
|
revs->diffopt.paths = argv + argc - 2;
|
||||||
revs->diffopt.nr_paths = 2;
|
revs->diffopt.nr_paths = 2;
|
||||||
revs->max_count = -2;
|
revs->max_count = -2;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче