Commit 5b575c2578fe24526fa3461ce4d6364b4c167de7

Stefan Sperling 2019-05-12T17:45:10

don't hide errors in got_ref_open()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/reference.c b/lib/reference.c
index 953af3c..5e5dc45 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -453,7 +453,7 @@ got_ref_open(struct got_reference **ref, struct got_repository *repo,
 	if (err)
 		goto done;
 done:
-	if (*ref == NULL)
+	if (!err && *ref == NULL)
 		err = got_error_not_ref(refname);
 	free(path_refs);
 	return err;