summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-06-13 20:19:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-13 20:19:40 (GMT)
commit0d107b19890db191c9281bff67180389fb53df24 (patch)
treed61a6fbd1e41b07107b7a686402c92f5283f7670 /refs.h
parent66dc7b68e4a332c662980b0266b9a1cb545f40ff (diff)
parent1de16aecf51daf5794aa074f6dd133e088a12690 (diff)
downloadgit-0d107b19890db191c9281bff67180389fb53df24.zip
git-0d107b19890db191c9281bff67180389fb53df24.tar.gz
git-0d107b19890db191c9281bff67180389fb53df24.tar.bz2
Merge branch 'nd/worktree-name-sanitization'
In recent versions of Git, per-worktree refs are exposed in refs/worktrees/<wtname>/ hierarchy, which means that worktree names must be a valid refname component. The code now sanitizes the names given to worktrees, to make sure these refs are well-formed. * nd/worktree-name-sanitization: worktree add: sanitize worktree names
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 2727405..730d05a 100644
--- a/refs.h
+++ b/refs.h
@@ -463,6 +463,12 @@ int for_each_reflog(each_ref_fn fn, void *cb_data);
*/
int check_refname_format(const char *refname, int flags);
+/*
+ * Apply the rules from check_refname_format, but mutate the result until it
+ * is acceptable, and place the result in "out".
+ */
+void sanitize_refname_component(const char *refname, struct strbuf *out);
+
const char *prettify_refname(const char *refname);
char *refs_shorten_unambiguous_ref(struct ref_store *refs,