Commit Diff


commit - 2d01eebaa7ef3ca94ce5f7307d82b8b57f0c19c9
commit + 2393f13b1ef9d6ffba0dba485d77acf0652f160c
blob - 97e57a0bf0084cd07fa638dc989adf1835b5c273
blob + 677e411cacaa1a0a0f88affac07523bb2f866751
--- lib/repository.c
+++ lib/repository.c
@@ -114,8 +114,12 @@ got_repo_open(struct got_repository **ret, const char 
 {
 	struct got_repository *repo = NULL;
 	const struct got_error *err = NULL;
-	char *abspath = got_path_get_absolute(path);
+	char *abspath;
 
+	if (got_path_is_absolute(path))
+		abspath = strdup(path);
+	else
+		abspath = got_path_get_absolute(path);
 	if (abspath == NULL)
 		return got_error(GOT_ERR_BAD_PATH);