Merge branch 'hn/path-ownership-comment'
Add comment to a few functions that use a short-lived buffer the caller can peek and copy out of. * hn/path-ownership-comment: read_gitfile_gently: clarify return value ownership. real_path: clarify return value ownership
This commit is contained in:
commit
9de7ae63c5
@ -202,6 +202,10 @@ error_out:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Resolve `path` into an absolute, cleaned-up path. The return value
|
||||||
|
* comes from a shared buffer.
|
||||||
|
*/
|
||||||
const char *real_path(const char *path)
|
const char *real_path(const char *path)
|
||||||
{
|
{
|
||||||
static struct strbuf realpath = STRBUF_INIT;
|
static struct strbuf realpath = STRBUF_INIT;
|
||||||
|
3
setup.c
3
setup.c
@ -541,7 +541,8 @@ void read_gitfile_error_die(int error_code, const char *path, const char *dir)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to read the location of the git directory from the .git file,
|
* Try to read the location of the git directory from the .git file,
|
||||||
* return path to git directory if found.
|
* return path to git directory if found. The return value comes from
|
||||||
|
* a shared buffer.
|
||||||
*
|
*
|
||||||
* On failure, if return_error_code is not NULL, return_error_code
|
* On failure, if return_error_code is not NULL, return_error_code
|
||||||
* will be set to an error code and NULL will be returned. If
|
* will be set to an error code and NULL will be returned. If
|
||||||
|
Loading…
x
Reference in New Issue
Block a user