summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-08-08 13:27:47 +0000
committerJunio C Hamano <gitster@pobox.com>2022-08-08 09:25:40 -0700
commit17d3883fe9c88b823002ad9fafb42313ddc3d3d5 (patch)
tree25e09eb1ecc069535b76559de03a50406db22fc6 /git-compat-util.h
parentd51e1dff980b9fc87002436b6ab36120a39816b1 (diff)
downloadgit-17d3883fe9c88b823002ad9fafb42313ddc3d3d5.tar.gz
setup: prepare for more detailed "dubious ownership" messages
When verifying the ownership of the Git directory, we sometimes would like to say a bit more about it, e.g. when using a platform-dependent code path (think: Windows has the permission model that is so different from Unix'), but only when it is a appropriate to actually say something. To allow for that, collect that information and hand it back to the caller (whose responsibility it is to show it or not). Note: We do not actually fill in any platform-dependent information yet, this commit just adds the infrastructure to be able to do so. Based-on-an-idea-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 58d7708296..36a25ae252 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -23,6 +23,9 @@
#include <crtdbg.h>
#endif
+struct strbuf;
+
+
#define _FILE_OFFSET_BITS 64
@@ -487,7 +490,7 @@ static inline void extract_id_from_env(const char *env, uid_t *id)
}
}
-static inline int is_path_owned_by_current_uid(const char *path)
+static inline int is_path_owned_by_current_uid(const char *path, struct strbuf *report)
{
struct stat st;
uid_t euid;