summaryrefslogtreecommitdiff
path: root/update-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-08-17 20:32:22 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-17 21:53:40 (GMT)
commitcfb0af1d50247e66ea1d46014650e60e9cfb87b9 (patch)
treeb473c7bd6d43a38e50259ecc4c2c5f62ffadd672 /update-cache.c
parent828cc617c1908a16b36734f62bb10299c2cfba6f (diff)
downloadgit-cfb0af1d50247e66ea1d46014650e60e9cfb87b9.zip
git-cfb0af1d50247e66ea1d46014650e60e9cfb87b9.tar.gz
git-cfb0af1d50247e66ea1d46014650e60e9cfb87b9.tar.bz2
[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>
Diffstat (limited to 'update-cache.c')
-rw-r--r--update-cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/update-cache.c b/update-cache.c
index 1fcc59a..63815ed 100644
--- a/update-cache.c
+++ b/update-cache.c
@@ -321,6 +321,7 @@ int main(int argc, char **argv)
{
int i, newfd, entries, has_errors = 0;
int allow_options = 1;
+ const char *prefix = setup_git_directory();
newfd = hold_index_file_for_update(&cache_file, get_index_file());
if (newfd < 0)
@@ -381,6 +382,7 @@ int main(int argc, char **argv)
}
die("unknown option %s", path);
}
+ path = prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
if (!verify_path(path)) {
fprintf(stderr, "Ignoring path %s\n", argv[i]);
continue;