summaryrefslogtreecommitdiff
path: root/builtin/init-db.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-03-17 12:26:46 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-17 16:08:30 -0700
commite2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2 (patch)
treeb17a832e94e5b0e6eeff36616a46205f4eb84571 /builtin/init-db.c
parenta3ca9b0fbe21d7a2525877fe0c008b61c56f7104 (diff)
downloadgit-e2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2.tar.gz
Name make_*_path functions more accurately
Rename the make_*_path functions so it's clearer what they do, in particlar make clear what the differnce between make_absolute_path and make_nonrelative_path is by renaming them real_path and absolute_path respectively. make_relative_path has an understandable name and is renamed to relative_path to maintain the name convention. The function calls have been replaced 1-to-1 in their usage. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/init-db.c')
-rw-r--r--builtin/init-db.c8
1 files changed, 4 insertions, 4 deletions
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);
}