https://github.com/git/git
Revision bdc77d1d685be9c10b88abb281a42bc620548595 authored by Johannes Schindelin on 02 March 2022, 10:06:24 UTC, committed by Johannes Schindelin on 21 March 2022, 12:16:26 UTC
This function will be used in the next commit to prevent
`setup_git_directory()` from discovering a repository in a directory
that is owned by someone other than the current user.

Note: We cannot simply use `st.st_uid` on Windows just like we do on
Linux and other Unix-like platforms: according to
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions
this field is always zero on Windows (because Windows' idea of a user ID
does not fit into a single numerical value). Therefore, we have to do
something a little involved to replicate the same functionality there.

Also note: On Windows, a user's home directory is not actually owned by
said user, but by the administrator. For all practical purposes, it is
under the user's control, though, therefore we pretend that it is owned
by the user.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 2a9a586
History
Tip revision: bdc77d1d685be9c10b88abb281a42bc620548595 authored by Johannes Schindelin on 02 March 2022, 10:06:24 UTC
Add a function to determine whether a path is owned by the current user
Tip revision: bdc77d1
File Mode Size
lib
macosx
po
windows
.gitattributes -rw-r--r-- 194 bytes
.gitignore -rw-r--r-- 97 bytes
GIT-VERSION-GEN -rwxr-xr-x 1.8 KB
Makefile -rw-r--r-- 11.6 KB
README.md -rw-r--r-- 6.1 KB
git-gui--askpass -rwxr-xr-x 1.8 KB
git-gui.sh -rwxr-xr-x 103.8 KB

README.md

back to top