]> git.e2factory.org Git - e2factory.git/commitdiff
improve error messages when creating git repos
authorTobias Ulmer <tu@emlix.com>
Wed, 14 Nov 2012 18:17:37 +0000 (19:17 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:11 +0000 (19:07 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/generic_git.lua

index 91dab54db40d76e9b0b19ebe8635fa48a0be4d3f..88a15021ea82c14f7d3d95d777c23357028ce4ce 100644 (file)
@@ -154,7 +154,7 @@ function generic_git.git_init_db1(rurl)
     if (not rurl) then
         e2lib.abort("git_init_db1(): missing parameter")
     end
-    local e = err.new("running git_init_db")
+    local e = err.new("git_init_db failed")
     local rc, re
     local u, re = url.parse(rurl)
     if not u then
@@ -173,7 +173,8 @@ function generic_git.git_init_db1(rurl)
     elseif u.transport == "file" then
         cmd = gitcmd
     else
-        return false, e:append("git_init_db1: transport not supported: %s", u.transport)
+        return false, err.new("git_init_db: can not initialize git repository"..
+            " on this transport: %s", u.transport)
     end
     rc = e2lib.callcmd_capture(cmd)
     if rc ~= 0 then
@@ -619,9 +620,9 @@ function generic_git.new_repository(c, lserver, llocation, rserver, rlocation, f
             return false, e:cat(re)
         end
     end
-    rc = generic_git.git_init_db(c, rserver, rlocation)
+    rc, re = generic_git.git_init_db(c, rserver, rlocation)
     if not rc then
-        return false, e:cat("can't initialize remote git repository")
+        return false, e:cat(re)
     end
     return true, nil
 end