From 59fc49d4cf9f98ff8b795a0eaef341fde1ad49d3 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Fri, 4 Dec 2009 12:45:32 +0100 Subject: [PATCH] git: verify that the project repository is on the tag matching the ReleaseId is clean, i.e. no unknown files around, no differences against HEAD Signed-off-by: Gordon Hecker --- local/e2tool.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/local/e2tool.lua b/local/e2tool.lua index e4f4736..53f205f 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -759,6 +759,28 @@ The newest configuration syntax supported by the tools is %s. if not rc then return false, e:cat(re) end + + if e2option.opts["check"] then + e2tool.lcd(info, ".") + rc, re = generic_git.verify_head_match_tag(nil, info.release_id) + if rc == nil then + e2lib.abort(e:cat(re)) + end + if not rc then + local msg = "project repository tag does not match the ReleaseId".. + " given in proj/config" + e:append(msg) + e2lib.abort(e:cat(re)) + end + rc, re = generic_git.verify_clean_repository(nil) + if rc == nil then + e2lib.abort(e:cat(re)) + end + if not rc then + e = new_error("project repository is not clean") + e2lib.abort(e:cat(re)) + end + end return info, nil end -- 2.39.5