diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-06-03 14:30:36 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-06-03 14:30:36 -0700 |
| commit | 37d4ae58efcc9f716435f327c39d5552aedb4b7c (patch) | |
| tree | 8c3601ab342858e0e2f21adc68e90493dadc116a /setup.c | |
| parent | 28db3b7b71c25e87cf7eed5406a1a1052311d330 (diff) | |
| parent | c37c6dc6a79a1ca7b9d4fa4efd788d8f5ec6369a (diff) | |
| download | git-37d4ae58efcc9f716435f327c39d5552aedb4b7c.tar.gz | |
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)
Diffstat (limited to 'setup.c')
| -rw-r--r-- | setup.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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); |
