summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 16:49:47 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 16:49:47 +0000
commitfbbda3e78dba2204df5f65a06383139d510573fb (patch)
tree19d6c6e2c3e28e0d9436206ffedf5f19490b56b8
parentab28dd6f838cac321e7276d0aa6ffbe4d8a53a36 (diff)
downloadgitano-fbbda3e78dba2204df5f65a06383139d510573fb.tar.bz2
Try and make detection of lack of repository somewhat automatic
-rw-r--r--lib/gitano/auth.lua2
-rw-r--r--lib/gitano/command.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitano/auth.lua b/lib/gitano/auth.lua
index 2583d79..f26dd55 100644
--- a/lib/gitano/auth.lua
+++ b/lib/gitano/auth.lua
@@ -95,7 +95,7 @@ local function is_authorized(user, source, cmdline, repo_root,
end
local repo
- if cmd.takes_repo and #parsed_cmdline > 1 then
+ if cmd.takes_repo and #parsed_cmdline >= 1 then
repo, parsed_cmdline = cmd.detect_repo(admin_conf, parsed_cmdline)
if not repo and not parsed_cmdline then
return nil
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua
index effe734..b2e04dd 100644
--- a/lib/gitano/command.lua
+++ b/lib/gitano/command.lua
@@ -27,6 +27,9 @@ local function default_detect_repo(config, parsed_cmdline)
if repo.is_nascent then
log.info("Repository " .. repo.name .. " is nascent")
end
+ else
+ log.critical("No repository provided.")
+ return nil, nil
end
return repo, parsed_cmdline
end