зеркало из https://github.com/microsoft/git.git
Merge pull request #3791: Various fixes around `safe.directory`
The first three commits are rebased versions of those in gitgitgadget/git#1215. These allow the following: 1. Fix `git config --global foo.bar <path>` from allowing the `<path>`. As a bonus, users with a config value starting with `/` will not get a warning about "old-style" paths needing a "`%(prefix)/`". 2. When in WSL, the path starts with `/` so it needs to be interpolated properly. Update the warning to include `%(prefix)/` to get the right value for WSL users. (This is specifically for using Git for Windows from Git Bash, but in a WSL directory.) 3. When using WSL, the ownership check fails and reports an error message. This is noisy, and happens even if the user has marked the path with `safe.directory`. Remove that error message.
This commit is contained in:
Коммит
40aaec0442
|
@ -3097,9 +3097,7 @@ int is_path_owned_by_current_sid(const char *path, struct strbuf *report)
|
|||
DACL_SECURITY_INFORMATION,
|
||||
&sid, NULL, NULL, NULL, &descriptor);
|
||||
|
||||
if (err != ERROR_SUCCESS)
|
||||
error(_("failed to get owner for '%s' (%ld)"), path, err);
|
||||
else if (sid && IsValidSid(sid)) {
|
||||
if (err == ERROR_SUCCESS && sid && IsValidSid(sid)) {
|
||||
/* Now, verify that the SID matches the current user's */
|
||||
static PSID current_user_sid;
|
||||
BOOL is_member;
|
||||
|
|
11
setup.c
11
setup.c
|
@ -1551,10 +1551,19 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
|||
break;
|
||||
case GIT_DIR_INVALID_OWNERSHIP:
|
||||
if (!nongit_ok) {
|
||||
struct strbuf prequoted = STRBUF_INIT;
|
||||
struct strbuf quoted = STRBUF_INIT;
|
||||
|
||||
strbuf_complete(&report, '\n');
|
||||
sq_quote_buf_pretty("ed, dir.buf);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
if (dir.buf[0] == '/')
|
||||
strbuf_addstr(&prequoted, "%(prefix)/");
|
||||
#endif
|
||||
|
||||
strbuf_add(&prequoted, dir.buf, dir.len);
|
||||
sq_quote_buf_pretty("ed, prequoted.buf);
|
||||
|
||||
die(_("detected dubious ownership in repository at '%s'\n"
|
||||
"%s"
|
||||
"To add an exception for this directory, call:\n"
|
||||
|
|
Загрузка…
Ссылка в новой задаче