summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-08 16:20:59 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-08 16:20:59 -0700
commit26c8a533afac9540e46e7d7707d9179772c6d2c8 (patch)
treee120298e53f63cc6fd50984a3111d96da900f780 /sha1_file.c
parent5c5dc2fb51ad43100881d563a9d07ac1b70a5607 (diff)
downloadgit-26c8a533afac9540e46e7d7707d9179772c6d2c8.tar.gz
Add "mkpath()" helper function
I'm bored with doing it by hand all the time.
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/sha1_file.c b/sha1_file.c
index fd6096f417..fc4e6bf91f 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -102,34 +102,6 @@ char *get_index_file(void)
return git_index_file;
}
-char *git_path(const char *fmt, ...)
-{
- static char pathname[PATH_MAX], *ret;
- va_list args;
- int len;
-
- if (!git_dir)
- setup_git_env();
- len = strlen(git_dir);
- if (len > PATH_MAX-100)
- return "pad-path";
- memcpy(pathname, git_dir, len);
- if (len && git_dir[len-1] != '/')
- pathname[len++] = '/';
- va_start(args, fmt);
- vsnprintf(pathname + len, sizeof(pathname) - len, fmt, args);
- va_end(args);
- ret = pathname;
-
- /* Clean it up */
- if (!memcmp(pathname, "./", 2)) {
- ret += 2;
- while (*ret == '/')
- ret++;
- }
- return ret;
-}
-
int safe_create_leading_directories(char *path)
{
char *pos = path;