diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-13 13:19:40 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-13 13:19:40 -0700 |
commit | 0d107b19890db191c9281bff67180389fb53df24 (patch) | |
tree | d61a6fbd1e41b07107b7a686402c92f5283f7670 /refs.h | |
parent | Merge branch 'en/fast-export-encoding' (diff) | |
parent | worktree add: sanitize worktree names (diff) | |
download | tgif-0d107b19890db191c9281bff67180389fb53df24.tar.xz |
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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, |