From 239f8ed6010828ca0dd15665800bdc9f779c15c0 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 5 Nov 2013 20:19:37 +0100 Subject: [PATCH] git.git_commit_id(): use lookup_id() function Signed-off-by: Tobias Ulmer --- plugins/git.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/git.lua b/plugins/git.lua index ad472f7..c27a4ef 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -138,19 +138,19 @@ function git.git_commit_id(info, sourcename, sourceset, check_remote) if sourceset == "branch" or (sourceset == "lazytag" and src.tag == "^") then ref = string.format("refs/heads/%s", src.branch) - rc, re, id = generic_git.git_rev_list1(gitdir, ref) + rc, re, id = generic_git.lookup_id(gitdir, false, ref) if not rc then return false, e:cat(re) end elseif sourceset == "tag" or (sourceset == "lazytag" and src.tag ~= "^") then ref = string.format("refs/tags/%s", src.tag) - rc, re, id = generic_git.git_rev_list1(gitdir, ref) + rc, re, id = generic_git.lookup_id(gitdir, false, ref) if not rc then return false, e:cat(re) end - if id ~= "" and check_remote then + if id and check_remote then rc, re = generic_git.verify_remote_tag(gitdir, src.tag) if not rc then return false, e:cat(re) @@ -160,7 +160,7 @@ function git.git_commit_id(info, sourcename, sourceset, check_remote) return false, err.new("not an scm sourceset: %s", sourceset) end - if id == "" then + if not id then re = err.new("can't get git commit ID for ref %q from repository %q", ref, src.working) return false, e:cat(re) -- 2.39.5