]> git.e2factory.org Git - e2factory.git/commitdiff
In git.check_workingcopy(), use lookup_id to find the branch
authorTobias Ulmer <tu@emlix.com>
Tue, 5 Nov 2013 19:31:33 +0000 (20:31 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:16 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/git.lua

index 406fcb0f85b09ae89bd39688606acaf909c6864a..f5a14cb6c98d79f66dfff8ec403845a8cd828938 100644 (file)
@@ -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.<branch>.remote == "origin"