]> git.e2factory.org Git - e2factory.git/commitdiff
git: verify that the project repository is on the tag matching the ReleaseId is clean...
authorGordon Hecker <gh@emlix.com>
Fri, 4 Dec 2009 11:45:32 +0000 (12:45 +0100)
committerGordon Hecker <gh@emlix.com>
Wed, 16 Dec 2009 14:37:28 +0000 (15:37 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
local/e2tool.lua

index e4f4736b5560b64012c0219d7754119df94a9078..53f205fcc1fb170103452846abed4f53d4446dee 100644 (file)
@@ -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