summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-08-10 09:32:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-10 22:15:41 (GMT)
commitf5895fd399855e782ed0f86f1ac0531517efa0d9 (patch)
tree6760d59bcb5873a737066f26bf562eb5da4d805b /cache.h
parent69ddd231fe8d4de64990d42b96d34940a7e43aef (diff)
downloadgit-f5895fd399855e782ed0f86f1ac0531517efa0d9.zip
git-f5895fd399855e782ed0f86f1ac0531517efa0d9.tar.gz
git-f5895fd399855e782ed0f86f1ac0531517efa0d9.tar.bz2
cache.h: complete set of git_path_submodule helpers
The git_path function has "git_pathdup" and "strbuf_git_path" variants, but git_submodule_path only comes in the dangerous, static-buffer variant. That makes refactoring callers to use the safer functions hard (since they don't exist). Since we're already using a strbuf behind the scenes, it's easy to expose all three of these interfaces with thin wrappers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 8db884e..6f74f33 100644
--- a/cache.h
+++ b/cache.h
@@ -724,10 +724,15 @@ extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
__attribute__((format (printf, 3, 4)));
extern void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
__attribute__((format (printf, 2, 3)));
+extern void strbuf_git_path_submodule(struct strbuf *sb, const char *path,
+ const char *fmt, ...)
+ __attribute__((format (printf, 3, 4)));
extern char *git_pathdup(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
extern char *mkpathdup(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
+extern char *git_pathdup_submodule(const char *path, const char *fmt, ...)
+ __attribute__((format (printf, 2, 3)));
extern void report_linked_checkout_garbage(void);