git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Make git-update-cache take relative pathnames

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 17, 2005, 20:32 UTC
Message-ID
<Pine.LNX.4.58.0508171331540.3553@g5.osdl.org>

This also makes "./filename" acceptable as a side effect, since the pathname normalization handles that too.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
 update-cache.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
ece92eeda777c3141f5692132ccc2ba7e4e801a2
diff --git a/update-cache.c b/update-cache.c
--- 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;
Message 1 of 1 in “Make git-update-cache take relative pathnames”
  1. 2/2 Make git-update-cache take relative pathnamesLinus Torvalds, Aug 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.