We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0aa000 commit 1c0a77cCopy full SHA for 1c0a77c
setup.c
@@ -1374,9 +1374,17 @@ const char *setup_git_directory_gently(int *nongit_ok)
1374
break;
1375
case GIT_DIR_INVALID_OWNERSHIP:
1376
if (!nongit_ok) {
1377
+ struct strbuf prequoted = STRBUF_INIT;
1378
struct strbuf quoted = STRBUF_INIT;
1379
- sq_quote_buf_pretty("ed, dir.buf);
1380
+#ifdef __MINGW32__
1381
+ if (dir.buf[0] == '/')
1382
+ strbuf_addstr(&prequoted, "%(prefix)/");
1383
+#endif
1384
+
1385
+ strbuf_add(&prequoted, dir.buf, dir.len);
1386
+ sq_quote_buf_pretty("ed, prequoted.buf);
1387
1388
die(_("unsafe repository ('%s' is owned by someone else)\n"
1389
"To add an exception for this directory, call:\n"
1390
"\n"
0 commit comments