summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
commita026bde1ac84f90f0b82faa18890b2023c5198d5 (patch)
tree8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /cache.h
parent09fb53568e3e00e30891b118045aa07ede524103 (diff)
parent3b754eedd58636926d07b14a34799a3aa7b8ebc2 (diff)
downloadgit-a026bde1ac84f90f0b82faa18890b2023c5198d5.zip
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.bz2
Merge branch 'jk/prefix-filename'
Code clean-up with minor bugfixes. * jk/prefix-filename: bundle: use prefix_filename with bundle path prefix_filename: simplify windows #ifdef prefix_filename: return newly allocated string prefix_filename: drop length parameter prefix_filename: move docstring to header file hash-object: fix buffer reuse with --path in a subdirectory
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 2214d52..db4120c 100644
--- 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 *prefix_filename(const char *prefix, int len, 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 is always a newly allocated string (even if the
+ * prefix was empty).
+ */
+extern char *prefix_filename(const char *prefix, const char *path);
+
extern int check_filename(const char *prefix, const char *name);
extern void verify_filename(const char *prefix,
const char *name,