fix git repository detection segv bug
diff --git a/lib/repository.c b/lib/repository.c
index 4f6a28e..d45495d 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -381,7 +381,7 @@ got_repo_open(struct got_repository **repop, const char *path)
} while (path);
done:
if (err)
- err = got_repo_close(repo);
+ got_repo_close(repo);
else
*repop = repo;
free(abspath);