diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-02 13:24:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-02 13:24:05 -0700 |
commit | e8e4ce72cd9ebb5e5dfe580f98b7764ca6dc08ea (patch) | |
tree | 667ad8fcbe657359f7041f62b9371fbc0b6f3516 /builtin | |
parent | 1d8a6f6929054919baf4032e22935523c2843f2c (diff) | |
parent | 2d186c8be5bea10640927e0822bd9e1c7a2e01ea (diff) | |
download | git-e8e4ce72cd9ebb5e5dfe580f98b7764ca6dc08ea.tar.gz git-e8e4ce72cd9ebb5e5dfe580f98b7764ca6dc08ea.tar.xz |
Merge branch 'rs/init-no-duplicate-real-path'
* rs/init-no-duplicate-real-path:
init: avoid superfluous real_path() calls
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/init-db.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 56f85e239..6d8ac2cc3 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -330,12 +330,12 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir, * moving the target repo later on in separate_git_dir() */ git_link = xstrdup(real_path(git_dir)); + set_git_dir(real_path(real_git_dir)); } else { - real_git_dir = real_path(git_dir); + set_git_dir(real_path(git_dir)); git_link = NULL; } - set_git_dir(real_path(real_git_dir)); return 0; } @@ -578,7 +578,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) die_errno (_("Cannot access current working directory")); } if (work_tree) - set_git_work_tree(real_path(work_tree)); + set_git_work_tree(work_tree); else set_git_work_tree(git_work_tree_cfg); if (access(get_git_work_tree(), X_OK)) @@ -587,7 +587,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) } else { if (work_tree) - set_git_work_tree(real_path(work_tree)); + set_git_work_tree(work_tree); } set_git_dir_init(git_dir, real_git_dir, 1); |