diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-28 20:52:19 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-28 20:52:19 (GMT) |
commit | cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06 (patch) | |
tree | d056097ed72d93eedc487640b463bde3650cd9a3 /strbuf.h | |
parent | c772d1bcdc058d655e6cd3518440a721433cb511 (diff) | |
parent | 33ad9ddd0b5398063f0aabea639b5fe569f458ea (diff) | |
download | git-cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06.zip git-cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06.tar.gz git-cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06.tar.bz2 |
Merge branch 'rs/strbuf-add-real-path' into maint
An helper function to make it easier to append the result from
real_path() to a strbuf has been added.
* rs/strbuf-add-real-path:
strbuf: add strbuf_add_real_path()
cocci: use ALLOC_ARRAY
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -441,6 +441,20 @@ extern int strbuf_getcwd(struct strbuf *sb); */ extern void strbuf_add_absolute_path(struct strbuf *sb, const char *path); +/** + * Canonize `path` (make it absolute, resolve symlinks, remove extra + * slashes) and append it to `sb`. Die with an informative error + * message if there is a problem. + * + * The directory part of `path` (i.e., everything up to the last + * dir_sep) must denote a valid, existing directory, but the last + * component need not exist. + * + * Callers that don't mind links should use the more lightweight + * strbuf_add_absolute_path() instead. + */ +extern void strbuf_add_real_path(struct strbuf *sb, const char *path); + /** * Normalize in-place the path contained in the strbuf. See |