summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c10
-rw-r--r--builtin/init-db.c8
-rw-r--r--builtin/receive-pack.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 2ee1fa9846..404f589680 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -100,7 +100,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
path = mkpath("%s%s", repo, suffix[i]);
if (is_directory(path)) {
*is_bundle = 0;
- return xstrdup(make_nonrelative_path(path));
+ return xstrdup(absolute_path(path));
}
}
@@ -109,7 +109,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
path = mkpath("%s%s", repo, bundle_suffix[i]);
if (!stat(path, &st) && S_ISREG(st.st_mode)) {
*is_bundle = 1;
- return xstrdup(make_nonrelative_path(path));
+ return xstrdup(absolute_path(path));
}
}
@@ -203,7 +203,7 @@ static void setup_reference(const char *repo)
struct transport *transport;
const struct ref *extra;
- ref_git = make_absolute_path(option_reference);
+ ref_git = real_path(option_reference);
if (is_directory(mkpath("%s/.git/objects", ref_git)))
ref_git = mkpath("%s/.git", ref_git);
@@ -411,7 +411,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
path = get_repo_path(repo_name, &is_bundle);
if (path)
- repo = xstrdup(make_nonrelative_path(repo_name));
+ repo = xstrdup(absolute_path(repo_name));
else if (!strchr(repo_name, ':'))
die("repository '%s' does not exist", repo_name);
else
@@ -466,7 +466,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (safe_create_leading_directories_const(git_dir) < 0)
die("could not create leading directories of '%s'", git_dir);
- set_git_dir(make_absolute_path(git_dir));
+ set_git_dir(real_path(git_dir));
if (0 <= option_verbosity)
printf("Cloning into %s%s...\n",
diff --git a/builtin/init-db.c b/builtin/init-db.c
index fbeb380ee2..8f5cfd7122 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -501,7 +501,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
const char *git_dir_parent = strrchr(git_dir, '/');
if (git_dir_parent) {
char *rel = xstrndup(git_dir, git_dir_parent - git_dir);
- git_work_tree_cfg = xstrdup(make_absolute_path(rel));
+ git_work_tree_cfg = xstrdup(real_path(rel));
free(rel);
}
if (!git_work_tree_cfg) {
@@ -510,7 +510,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(make_absolute_path(work_tree));
+ set_git_work_tree(real_path(work_tree));
else
set_git_work_tree(git_work_tree_cfg);
if (access(get_git_work_tree(), X_OK))
@@ -519,10 +519,10 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
}
else {
if (work_tree)
- set_git_work_tree(make_absolute_path(work_tree));
+ set_git_work_tree(real_path(work_tree));
}
- set_git_dir(make_absolute_path(git_dir));
+ set_git_dir(real_path(git_dir));
return init_db(template_dir, flags);
}
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 760817dbd7..d883585804 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -740,7 +740,7 @@ static int add_refs_from_alternate(struct alternate_object_database *e, void *un
const struct ref *extra;
e->name[-1] = '\0';
- other = xstrdup(make_absolute_path(e->base));
+ other = xstrdup(real_path(e->base));
e->name[-1] = '/';
len = strlen(other);