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>
This commit is contained in:

committed by
Junio C Hamano

parent
a3ca9b0fbe
commit
e2a57aac8a
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user