Skip to content

Commit

Permalink
setup: properly use "%(prefix)/" when in WSL
Browse files Browse the repository at this point in the history
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
  • Loading branch information
derrickstolee authored and dscho committed Oct 20, 2024
1 parent 1c8b997 commit 4b4ba6a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,10 +1777,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(&quoted, dir.buf);

#ifdef __MINGW32__
if (dir.buf[0] == '/')
strbuf_addstr(&prequoted, "%(prefix)/");
#endif

strbuf_add(&prequoted, dir.buf, dir.len);
sq_quote_buf_pretty(&quoted, prequoted.buf);

die(_("detected dubious ownership in repository at '%s'\n"
"%s"
"To add an exception for this directory, call:\n"
Expand Down

0 comments on commit 4b4ba6a

Please sign in to comment.