Commit Diff


commit - 6e47225242a2b742817ecafa41e4ff88046b7f88
commit + 6876e2035e5226e05e591587b31ab2a9b477034b
blob - 39c436e7f663ea304f8d339f4eebc4f646156e15
blob + 6ea6d7bebdac0acf0c5b36dd4fb07f6b02579e12
--- lib/repository.c
+++ lib/repository.c
@@ -329,7 +329,7 @@ got_repo_open(struct got_repository **repop, const cha
 {
 	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 cha
 	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;
 }