Skip to content

Commit 72b8c93

Browse files
mtelkagitster
authored andcommitted
scalar: make enlistment delete to work on all POSIX platforms
The ability to remove the current working directory is not guaranteed by POSIX so it is better to go out of the directory we want to delete on all platforms unconditionally. Signed-off-by: Marcel Telka <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d8ab1d4 commit 72b8c93

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

scalar.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,13 @@ static char *remote_default_branch(const char *url)
361361

362362
static int delete_enlistment(struct strbuf *enlistment)
363363
{
364-
#ifdef WIN32
365364
struct strbuf parent = STRBUF_INIT;
366365
size_t offset;
367366
char *path_sep;
368-
#endif
369367

370368
if (unregister_dir())
371369
return error(_("failed to unregister repository"));
372370

373-
#ifdef WIN32
374371
/*
375372
* Change the current directory to one outside of the enlistment so
376373
* that we may delete everything underneath it.
@@ -385,7 +382,6 @@ static int delete_enlistment(struct strbuf *enlistment)
385382
return res;
386383
}
387384
strbuf_release(&parent);
388-
#endif
389385

390386
if (have_fsmonitor_support() && stop_fsmonitor_daemon())
391387
return error(_("failed to stop the FSMonitor daemon"));

0 commit comments

Comments
 (0)