diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-05 17:50:06 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-05 17:50:06 -0700 |
commit | 09895c1fa02f77acb2bde3d7e9da675eeb1271cf (patch) | |
tree | 5ba7100e98ca9bab7cc0492a7d2de8c67d8c2c71 /update-index.c | |
parent | 86118bcb463e3f34b3df21d550335a40586dfb66 (diff) | |
download | git-09895c1fa02f77acb2bde3d7e9da675eeb1271cf.tar.gz |
update-index --unresolve: work from a subdirectory.
It completely forgot to take the prefix into account, so you
had to feed the full path even when you start from a
subdirectory, which was nonsensical.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'update-index.c')
-rw-r--r-- | update-index.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/update-index.c b/update-index.c index 9fa3d2bb96..1870ac7966 100644 --- a/update-index.c +++ b/update-index.c @@ -576,7 +576,8 @@ static void read_head_pointers(void) } } -static int do_unresolve(int ac, const char **av) +static int do_unresolve(int ac, const char **av, + const char *prefix, int prefix_length) { int i; int err = 0; @@ -588,7 +589,10 @@ static int do_unresolve(int ac, const char **av) for (i = 1; i < ac; i++) { const char *arg = av[i]; - err |= unresolve_one(arg); + const char *p = prefix_path(prefix, prefix_length, arg); + err |= unresolve_one(p); + if (p != arg) + free((char*)p); } return err; } @@ -704,7 +708,8 @@ int main(int argc, const char **argv) break; } if (!strcmp(path, "--unresolve")) { - has_errors = do_unresolve(argc - i, argv + i); + has_errors = do_unresolve(argc - i, argv + i, + prefix, prefix_length); if (has_errors) active_cache_changed = 0; goto finish; |