From: Linus Torvalds Date: Wed, 17 Aug 2005 20:31:49 +0000 (-0700) Subject: [PATCH] Export relative path handling "prefix_path()" function X-Git-Tag: v0.99.5~15^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=828cc617c1908a16b36734f62bb10299c2cfba6f;p=git.git [PATCH] Export relative path handling "prefix_path()" function 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 Signed-off-by: Junio C Hamano --- diff --git a/cache.h b/cache.h index 6365381c1..742378f40 100644 --- 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 index 1710b1685..b8789de5c 100644 --- 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 (;;) {