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

[PATCH 1/2] Export relative path handling "prefix_path()" function

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

Not all programs necessarily have a pathspec array of pathnames, some of them (like git-update-cache) want to do things one file at a time. So export the single-path interface too.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
 cache.h |    1 +
 setup.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
c06157a36e49182c34e1e92aa7b329bde5dca3f9
diff --git a/cache.h b/cache.h
--- a/cache.h
+++ b/cache.h
@@ -142,6 +142,7 @@ extern char *get_graft_file(void);
 
 extern const char **get_pathspec(const char *prefix, char **pathspec);
 extern const char *setup_git_directory(void);
+extern char *prefix_path(const char *prefix, int len, char *path);
 
 #define alloc_nr(x) (((x)+16)*3/2)
 
diff --git a/setup.c b/setup.c
--- a/setup.c
+++ b/setup.c
@@ -1,6 +1,6 @@
 #include "cache.h"
 
-static char *prefix_path(const char *prefix, int len, char *path)
+char *prefix_path(const char *prefix, int len, char *path)
 {
 	char *orig = path;
 	for (;;) {
Message 1 of 1 in “Export relative path handling "prefix_path()" function”
  1. 1/2 Export relative path handling "prefix_path()" functionLinus 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.