summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e551208)
raw | patch | inline | side by side (parent: e551208)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Mar 2007 07:45:14 +0000 (23:45 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Mar 2007 07:45:14 +0000 (23:45 -0800) |
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>
to adjust paths given to it with prefix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-lib.c | patch | blob | history |
diff --git a/diff-lib.c b/diff-lib.c
index 75ff0dd93d79ea77877151c50ae30580f1f00342..88e59b5794236e8ca3162c8dd823ea1a64b4683b 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
die("invalid diff option/value: %s", argv[i]);
i += j;
}
- revs->diffopt.paths = argv + argc - 2;
+
+ 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.nr_paths = 2;
revs->max_count = -2;
return 0;