Skip to content

Commit 4213f0f

Browse files
derrickstoleeGit for Windows Build Agent
authored andcommitted
setup: properly use "%(prefix)/" when in WSL
Signed-off-by: Derrick Stolee <[email protected]>
1 parent 6901798 commit 4213f0f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

setup.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,10 +1785,19 @@ const char *setup_git_directory_gently(int *nongit_ok)
17851785
break;
17861786
case GIT_DIR_INVALID_OWNERSHIP:
17871787
if (!nongit_ok) {
1788+
struct strbuf prequoted = STRBUF_INIT;
17881789
struct strbuf quoted = STRBUF_INIT;
17891790

17901791
strbuf_complete(&report, '\n');
1791-
sq_quote_buf_pretty(&quoted, dir.buf);
1792+
1793+
#ifdef __MINGW32__
1794+
if (dir.buf[0] == '/')
1795+
strbuf_addstr(&prequoted, "%(prefix)/");
1796+
#endif
1797+
1798+
strbuf_add(&prequoted, dir.buf, dir.len);
1799+
sq_quote_buf_pretty(&quoted, prequoted.buf);
1800+
17921801
die(_("detected dubious ownership in repository at '%s'\n"
17931802
"%s"
17941803
"To add an exception for this directory, call:\n"

0 commit comments

Comments
 (0)