Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
prefix_filename: move docstring to header file
author
Jeff King
<peff@peff.net>
Tue, 21 Mar 2017 01:21:27 +0000
(21:21 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 21 Mar 2017 18:12:52 +0000
(11:12 -0700)
This is a public function, so we should make its
documentation available near the declaration.
While we're at it, we can give a few details about how it
works.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
abspath.c
patch
|
blob
|
history
cache.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a1be47e
)
diff --git
a/abspath.c
b/abspath.c
index b02e068aa347db683b00246061b48bfafabbc1c0..fd30aff08fdae93ecb7283b4e145cab41fd2f9c9 100644
(file)
--- a/
abspath.c
+++ b/
abspath.c
@@
-246,11
+246,6
@@
char *absolute_pathdup(const char *path)
return strbuf_detach(&sb, NULL);
}
return strbuf_detach(&sb, NULL);
}
-/*
- * Unlike prefix_path, this should be used if the named file does
- * not have to interact with index entry; i.e. name of a random file
- * on the filesystem.
- */
const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
{
static struct strbuf path = STRBUF_INIT;
const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
{
static struct strbuf path = STRBUF_INIT;
diff --git
a/cache.h
b/cache.h
index 9b2157f59112be6f9d2733d460ffe36f8937c6c7..a01668fc42e72815489b552f8960118353f2cfd1 100644
(file)
--- a/
cache.h
+++ b/
cache.h
@@
-529,7
+529,19
@@
extern const char *setup_git_directory_gently(int *);
extern const char *setup_git_directory(void);
extern char *prefix_path(const char *prefix, int len, const char *path);
extern char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
extern const char *setup_git_directory(void);
extern char *prefix_path(const char *prefix, int len, const char *path);
extern char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
+
+/*
+ * Concatenate "prefix" (if len is non-zero) and "path", with no
+ * connecting characters (so "prefix" should end with a "/").
+ * Unlike prefix_path, this should be used if the named file does
+ * not have to interact with index entry; i.e. name of a random file
+ * on the filesystem.
+ *
+ * The return value may point to static storage which will be overwritten by
+ * further calls.
+ */
extern const char *prefix_filename(const char *prefix, int len, const char *path);
extern const char *prefix_filename(const char *prefix, int len, const char *path);
+
extern int check_filename(const char *prefix, const char *name);
extern void verify_filename(const char *prefix,
const char *name,
extern int check_filename(const char *prefix, const char *name);
extern void verify_filename(const char *prefix,
const char *name,