summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-10 14:59:59 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-03-11 14:04:53 +0000
commitc101d7d310b908ad88a61efb499b8ee14f94fdb5 (patch)
tree8626961426870cf181540bfb5511eacfdf3bbeb0 /bin
parentb4e1b4a3ef063e8447bb5299c7ea40ba9296b35d (diff)
downloadgitano-c101d7d310b908ad88a61efb499b8ee14f94fdb5.tar.gz
Use new configurable repository detectionbaserock/danielsilverstone/S10633-repo-detection
Each of these callsites independently detected repositories before. Now they use the configurable repository detection which means (a) they are unified in their behaviour and (b) they can take advantage of new commands which might not have repositories represented in the same way. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'bin')
-rw-r--r--bin/gitano-auth.in16
1 files changed, 4 insertions, 12 deletions
diff --git a/bin/gitano-auth.in b/bin/gitano-auth.in
index 55712f4..3901166 100644
--- a/bin/gitano-auth.in
+++ b/bin/gitano-auth.in
@@ -105,18 +105,10 @@ if not cmd then
gitano.log.fatal("Unknown command: " .. parsed_cmdline[1])
end
-if cmd.takes_repo and #parsed_cmdline > 1 then
- -- Acquire the repository object for the target repo
- local msg
- repo, msg = gitano.repository.find(config, parsed_cmdline[2])
- if not repo then
- gitano.log.critical("Unable to locate repository.")
- gitano.log.critical(" * " .. (tostring(msg)))
- gitano.log.fatal("Cannot continue")
- end
-
- if repo.is_nascent then
- gitano.log.info("Repository " .. repo.name .. " is nascent")
+if cmd.takes_repo then
+ repo, parsed_cmdline = cmd.detect_repo(config, parsed_cmdline)
+ if not repo and not parsed_cmdline then
+ gitano.log.fatal("Failed to acquire repository object")
end
end