From 63679edaba31a81b3081cd17e250ffa09644c5a4 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 5 Nov 2013 20:31:33 +0100 Subject: [PATCH] In git.check_workingcopy(), use lookup_id to find the branch Signed-off-by: Tobias Ulmer --- plugins/git.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" -- 2.39.5