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 Sep 16, 2022
1 parent 5020b08 commit c22d07e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion setup.c
Expand Up @@ -1482,10 +1482,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 c22d07e

Please sign in to comment.