summaryrefslogtreecommitdiffstats
path: root/path.h
diff options
context:
space:
mode:
authorCalvin Wan <calvinwan@google.com>2023-06-06 21:48:42 +0200
committerJunio C Hamano <gitster@pobox.com>2023-06-12 22:49:36 +0200
commitaba070683295a20bdf4f49146384984961c794b2 (patch)
tree7443395ecf2bee3aa871646474576feab241984d /path.h
parentobject-name: move related functions to object-name (diff)
downloadgit-aba070683295a20bdf4f49146384984961c794b2.tar.xz
git-aba070683295a20bdf4f49146384984961c794b2.zip
path: move related function to path
Move path-related function from strbuf.[ch] to path.[ch] so that strbuf is focused on string manipulation routines with minimal dependencies. repository.h is no longer a necessary dependency after moving this function out. Signed-off-by: Calvin Wan <calvinwan@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.h')
-rw-r--r--path.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/path.h b/path.h
index 60e83a49a9..639372edd9 100644
--- a/path.h
+++ b/path.h
@@ -191,6 +191,11 @@ const char *remove_leading_path(const char *in, const char *prefix);
const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
int normalize_path_copy(char *dst, const char *src);
+/**
+ * Normalize in-place the path contained in the strbuf. If an error occurs,
+ * the contents of "sb" are left untouched, and -1 is returned.
+ */
+int strbuf_normalize_path(struct strbuf *src);
int longest_ancestor_length(const char *path, struct string_list *prefixes);
char *strip_path_suffix(const char *path, const char *suffix);
int daemon_avoid_alias(const char *path);