mirror of
https://github.com/git/git.git
synced 2024-10-28 21:07:52 +01:00
[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 <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
049f28c392
commit
828cc617c1
2 changed files with 2 additions and 1 deletions
1
cache.h
1
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 **get_pathspec(const char *prefix, char **pathspec);
|
||||||
extern const char *setup_git_directory(void);
|
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)
|
#define alloc_nr(x) (((x)+16)*3/2)
|
||||||
|
|
||||||
|
|
2
setup.c
2
setup.c
|
@ -1,6 +1,6 @@
|
||||||
#include "cache.h"
|
#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;
|
char *orig = path;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
Loading…
Reference in a new issue