summaryrefslogtreecommitdiff
path: root/lib/gitano/command.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitano/command.lua')
-rw-r--r--lib/gitano/command.lua54
1 files changed, 2 insertions, 52 deletions
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua
index da20dea..c8f537a 100644
--- a/lib/gitano/command.lua
+++ b/lib/gitano/command.lua
@@ -937,63 +937,13 @@ assert(register_cmd("ls", builtin_ls_short, builtin_ls_helptext,
builtin_ls_validate, builtin_ls_prep, builtin_ls_run,
false, false))
-local builtin_gc_short = "Invoke git gc on your repository"
-local builtin_gc_helptext = [[
-usage: gc repo [options]
-
-Invoke, git gc, passing the given options, on the given repository.
-You must have basic write access to the repository in order to invoke a gc.
-]]
-
-local function builtin_gc_prep(config, repo, cmdline, context)
- context.operation = "write"
- return repo:run_lace(context)
-end
-
-local builtin_count_objects_short = "Count objects in your projects"
-local builtin_count_objects_helptext = [[
-usage: count-objects repo [options]
-
-Counts objects in your repository.
-
-You must have read access to the repository in order
-to run count-objects.
-]]
-
-local function builtin_count_objects_prep(config, repo, cmdline, context)
- context.operation = "read"
- return repo:run_lace(context)
-end
-
-local function builtin_simple_validate(config, repo, cmdline)
- if not repo or repo.is_nascent then
- log.error("Unable to proceed, repository does not exist")
- return false
- end
- return true
-end
-
-local function builtin_simple_run(config, repo, cmdline, env)
- local cmdcopy = {env=util.deep_copy(env), "git", cmdline[1]}
- cmdcopy.env.GIT_DIR=repo:fs_path()
- for i = 3, #cmdline do cmdcopy[#cmdcopy+1] = cmdline[i] end
- local proc = sp.spawn(cmdcopy)
- return proc:wait()
-end
-
-assert(register_cmd("gc", builtin_gc_short, builtin_gc_helptext,
- builtin_simple_validate, builtin_gc_prep,
- builtin_simple_run, true, false))
-
-assert(register_cmd("count-objects", builtin_count_objects_short,
- builtin_count_objects_helptext, builtin_simple_validate,
- builtin_count_objects_prep, builtin_simple_run,
- true, false))
local usercmds = require 'gitano.usercommand'
usercmds.register(register_cmd)
local admincmds = require 'gitano.admincommand'
admincmds.register(register_cmd)
+local repocmds = require 'gitano.repocommand'
+repocmds.register(register_cmd)
return {
register = register_cmd,