aboutsummaryrefslogtreecommitdiff
path: root/lpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpm.c')
-rw-r--r--lpm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lpm.c b/lpm.c
index 944a98a..c8584a5 100644
--- a/lpm.c
+++ b/lpm.c
@@ -287,9 +287,7 @@ static git_repository* luaL_checkgitrepo(lua_State* L, int index) {
static git_commit* git_retrieve_commit(git_repository* repository, const char* commit_name) {
git_oid commit_id;
git_commit* commit;
- if (git_get_id(&commit_id, repository, commit_name))
- return NULL;
- if (git_commit_lookup(&commit, repository, &commit_id))
+ if (git_get_id(&commit_id, repository, commit_name) || git_commit_lookup(&commit, repository, &commit_id))
return NULL;
return commit;
}