From: Tobias Ulmer Date: Tue, 5 Nov 2013 19:31:33 +0000 (+0100) Subject: In git.check_workingcopy(), use lookup_id to find the branch X-Git-Tag: e2factory-2.3.15rc1~412 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=63679edaba31a81b3081cd17e250ffa09644c5a4;p=e2factory.git In git.check_workingcopy(), use lookup_id to find the branch Signed-off-by: Tobias Ulmer --- diff --git a/plugins/git.lua b/plugins/git.lua index 406fcb0..f5a14cb 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -635,11 +635,13 @@ function git.check_workingcopy(info, sourcename) local src = info.sources[sourcename] local gitdir = e2lib.join(info.root, src.working, ".git") local ref = string.format("refs/heads/%s", src.branch) + local id - rc, re = generic_git.git_rev_list1(gitdir, ref) + rc, re, id = generic_git.lookup_id(gitdir, false, ref) if not rc then - e:append("branch \"%s\" does not exist", src.branch) return false, e:cat(re) + elseif not id then + return false, e:cat(err.new("branch %q does not exist", src.branch)) end -- git config branch..remote == "origin"