]> git.e2factory.org Git - e2factory.git/commitdiff
e2-install-e2: cleanup ref variable
authorTobias Ulmer <tu@emlix.com>
Wed, 9 Nov 2016 17:41:10 +0000 (18:41 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
global/e2-install-e2.lua

index 66ea97c9d42c50f5a48d45173aafcfb072842745..7073109c5818c3e5d6b871085b41887b36c5826d 100644 (file)
@@ -143,13 +143,10 @@ local function e2_install_e2(arg)
     end
 
     for _,ex in ipairs(extensions) do
-        local ref
-        if ex.ref:match("/") then
-            ref = ex.ref
-        else
-            ref = string.format("refs/tags/%s", ex.ref)
+        if not ex.ref:match("/") then
+            ex.ref = string.format("refs/tags/%s", ex.ref)
         end
-        e2lib.logf(2, "fetching extension: %s (%s)", ex.name, ref)
+        e2lib.logf(2, "fetching extension: %s (%s)", ex.name, ex.ref)
         local server = config.site.e2_server
         local location = string.format("%s/%s.git", config.site.e2_base, ex.name)
         local destdir = e2lib.join(root, ".e2/e2/extensions", ex.name)
@@ -167,7 +164,7 @@ local function e2_install_e2(arg)
             error(e:cat(re))
         end
 
-        rc, re = generic_git.git_checkout1(destdir, ref)
+        rc, re = generic_git.git_checkout1(destdir, ex.ref)
         if not rc then
             error(e:cat(re))
         end