Commit Diff


commit - 66b4983c7383b3536005f0f2480d65ea8c0c1c87
commit + a19e88aae8ac5b64c1e28aba5370ea00a04538e6
blob - f3360e6a5d48fcf2e178a43ef89bd309c72d0443
blob + 369637070d9aa44637da03ca707332640d4d7e1e
--- tog/tog.c
+++ tog/tog.c
@@ -1158,20 +1158,18 @@ cmd_blame(int argc, char *argv[])
 			goto done;
 		error = got_ref_resolve(&commit_id, repo, head_ref);
 		got_ref_close(head_ref);
-		if (error != NULL)
-			goto done;
 	} else {
 		struct got_object *obj;
 		error = got_object_open_by_id_str(&obj, repo, commit_id_str);
 		if (error != NULL)
 			goto done;
 		commit_id = got_object_get_id(obj);
-		got_object_close(obj);
-		if (commit_id == NULL) {
+		if (commit_id == NULL)
 			error = got_error_from_errno();
-			goto done;
-		}
+		got_object_close(obj);
 	}
+	if (error != NULL)
+		goto done;
 
 	error = show_blame_view(path, commit_id, repo);
 done: