1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 17:16:34 +02:00

Merge branch 'kl/setup-in-unreadable-worktree'

Disable the "do not remove the directory the user started Git in"
logic when Git cannot tell where that directory is.  Earlier we
refused to run in such a case.

* kl/setup-in-unreadable-worktree:
  setup: don't die if realpath(3) fails on getcwd(3)
This commit is contained in:
Junio C Hamano 2022-06-03 14:30:36 -07:00
commit 37d4ae58ef

11
setup.c
View File

@ -459,7 +459,16 @@ static void setup_original_cwd(void)
*/
/* Normalize the directory */
strbuf_realpath(&tmp, tmp_original_cwd, 1);
if (!strbuf_realpath(&tmp, tmp_original_cwd, 0)) {
trace2_data_string("setup", the_repository,
"realpath-path", tmp_original_cwd);
trace2_data_string("setup", the_repository,
"realpath-failure", strerror(errno));
free((char*)tmp_original_cwd);
tmp_original_cwd = NULL;
return;
}
free((char*)tmp_original_cwd);
tmp_original_cwd = NULL;
startup_info->original_cwd = strbuf_detach(&tmp, NULL);