summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-18 23:12:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-18 23:12:16 (GMT)
commit1c16df23b19e8d37d896e68c92d8341d6e60b4dc (patch)
treed7e0ab46f28e103de500cee9d6edbb987bd40a96 /dir.c
parent5918bdcf26030a2540ac25d5b8cbee82fad219fc (diff)
parent0b9864aa28ba08d7fb901afee1a75a15e4ad431b (diff)
downloadgit-1c16df23b19e8d37d896e68c92d8341d6e60b4dc.zip
git-1c16df23b19e8d37d896e68c92d8341d6e60b4dc.tar.gz
git-1c16df23b19e8d37d896e68c92d8341d6e60b4dc.tar.bz2
Merge branch 'bw/realpath-wo-chdir'
The implementation of "real_path()" was to go there with chdir(2) and call getcwd(3), but this obviously wouldn't be usable in a threaded environment. Rewrite it to manually resolve relative paths including symbolic links in path components. * bw/realpath-wo-chdir: real_path: set errno when max number of symlinks is exceeded real_path: prevent redefinition of MAXSYMLINKS
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 4ac63bc..65c3e68 100644
--- a/dir.c
+++ b/dir.c
@@ -2731,8 +2731,8 @@ void connect_work_tree_and_git_dir(const char *work_tree_, const char *git_dir_)
{
struct strbuf file_name = STRBUF_INIT;
struct strbuf rel_path = STRBUF_INIT;
- char *git_dir = xstrdup(real_path(git_dir_));
- char *work_tree = xstrdup(real_path(work_tree_));
+ char *git_dir = real_pathdup(git_dir_);
+ char *work_tree = real_pathdup(work_tree_);
/* Update gitfile */
strbuf_addf(&file_name, "%s/.git", work_tree);