remove another pointless call to got_path_normalize()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/lib/repository.c b/lib/repository.c
index 39c436e..6ea6d7b 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -329,7 +329,7 @@ got_repo_open(struct got_repository **repop, const char *path)
{
struct got_repository *repo = NULL;
const struct got_error *err = NULL;
- char *abspath, *normpath = NULL;
+ char *abspath;
int i, tried_root = 0;
*repop = NULL;
@@ -370,13 +370,12 @@ got_repo_open(struct got_repository **repop, const char *path)
if (err)
goto done;
- normpath = got_path_normalize(abspath);
- if (normpath == NULL) {
- err = got_error(GOT_ERR_BAD_PATH);
+ path = realpath(abspath, NULL);
+ if (path == NULL) {
+ err = got_error_from_errno2("realpath", path);
goto done;
}
- path = normpath;
do {
err = open_repo(repo, path);
if (err == NULL)
@@ -400,7 +399,6 @@ done:
else
*repop = repo;
free(abspath);
- free(normpath);
return err;
}