[PATCH] Make git-update-cache take relative pathnames
This also makes "./filename" acceptable as a side effect, since the pathname normalization handles that too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
828cc617c1
commit
cfb0af1d50
@ -321,6 +321,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int i, newfd, entries, has_errors = 0;
|
int i, newfd, entries, has_errors = 0;
|
||||||
int allow_options = 1;
|
int allow_options = 1;
|
||||||
|
const char *prefix = setup_git_directory();
|
||||||
|
|
||||||
newfd = hold_index_file_for_update(&cache_file, get_index_file());
|
newfd = hold_index_file_for_update(&cache_file, get_index_file());
|
||||||
if (newfd < 0)
|
if (newfd < 0)
|
||||||
@ -381,6 +382,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
die("unknown option %s", path);
|
die("unknown option %s", path);
|
||||||
}
|
}
|
||||||
|
path = prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
|
||||||
if (!verify_path(path)) {
|
if (!verify_path(path)) {
|
||||||
fprintf(stderr, "Ignoring path %s\n", argv[i]);
|
fprintf(stderr, "Ignoring path %s\n", argv[i]);
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user