]> git.e2factory.org Git - e2factory.git/commitdiff
git: fetch tags and pull ff-only
authorTobias Ulmer <tu@emlix.com>
Fri, 19 Feb 2016 14:18:11 +0000 (15:18 +0100)
committerTobias Ulmer <tu@emlix.com>
Fri, 19 Feb 2016 14:18:11 +0000 (15:18 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
Changelog
local/git.lua

index a6b3e86e48410a4f0bd872fd88c5c9840911df89..a804e5c4552d4afb1097cff1ba10eca72541392b 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
 NEXT:
+ * on git source update, fetch tags and prevent non-ff merges
 
 e2factory-2.3.14p1
  * Provide io.open/io.popen wrappers that set FD_CLOEXEC
index 759dfefc7e544637ddcbd89aed67f1a507529db4..9981a94e1b68986db33aea77b4a665504bef4f09 100644 (file)
@@ -205,6 +205,10 @@ function git.update(info, sourcename)
     if not rc then
         return false, e:cat(re)
     end
+    rc, re = e2lib.git(nil, "fetch", "--tags")
+    if not rc then
+        return false, e:cat(re)
+    end
     e:append("fetch succeeded")
 
     -- setup the branch tracking its remote. This fails if the branch exists,
@@ -227,7 +231,7 @@ function git.update(info, sourcename)
     if not rc then
         return false, e:append("working copy not available")
     end
-    rc, re = e2lib.git(nil, "pull")
+    rc, re = e2lib.git(nil, "pull", "--ff-only")
     if not rc then
         return false, e:cat(re)
     end