summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:48 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:48 +0900
commit9de7ae63c53ae050f7061d451174a489fa51c80f (patch)
tree399b0fca26899b2eb8ddfb68f081098db0ae5af5
parent2f777fad342e5a12cc910516ba575db4c3e4e53a (diff)
parentea1d87560c5d66396d1785a208783cbf7a1651c2 (diff)
downloadgit-9de7ae63c53ae050f7061d451174a489fa51c80f.tar.gz
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
-rw-r--r--abspath.c4
-rw-r--r--setup.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/abspath.c b/abspath.c
index 708aff8d42..9857985329 100644
--- a/abspath.c
+++ b/abspath.c
@@ -202,6 +202,10 @@ error_out:
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)
{
static struct strbuf realpath = STRBUF_INIT;
diff --git a/setup.c b/setup.c
index 6d8380acd2..d777ff34b7 100644
--- a/setup.c
+++ b/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,
- * 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
* will be set to an error code and NULL will be returned. If