{"thread":{"id":"1562","subject":"[PATCH 2/2] Make git-update-cache take relative pathnames","startedAt":"2005-08-17T20:32:22Z","lastAt":"2005-08-17T20:32:22Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"7468","messageId":"Pine.LNX.4.58.0508171331540.3553@g5.osdl.org","threadId":"1562","inReplyTo":null,"subject":"[PATCH 2/2] Make git-update-cache take relative pathnames","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-17T20:32:22Z","receivedAt":"2005-08-17T20:32:22Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThis also makes \"./filename\" acceptable as a side effect, since the\npathname normalization handles that too.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\n\n update-cache.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\nece92eeda777c3141f5692132ccc2ba7e4e801a2\ndiff --git a/update-cache.c b/update-cache.c\n--- a/update-cache.c\n+++ b/update-cache.c\n@@ -321,6 +321,7 @@ int main(int argc, char **argv)\n {\n \tint i, newfd, entries, has_errors = 0;\n \tint allow_options = 1;\n+\tconst char *prefix = setup_git_directory();\n \n \tnewfd = hold_index_file_for_update(&cache_file, get_index_file());\n \tif (newfd < 0)\n@@ -381,6 +382,7 @@ int main(int argc, char **argv)\n \t\t\t}\n \t\t\tdie(\"unknown option %s\", path);\n \t\t}\n+\t\tpath = prefix_path(prefix, prefix ? strlen(prefix) : 0, path);\n \t\tif (!verify_path(path)) {\n \t\t\tfprintf(stderr, \"Ignoring path %s\\n\", argv[i]);\n \t\t\tcontinue;\n"}]}