diff options
author | Richard Maw <richard.maw@gmail.com> | 2017-08-01 16:22:09 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@gmail.com> | 2017-08-01 16:22:09 +0100 |
commit | ea45bb9535fceea9c9feebde0360c594fc985fe1 (patch) | |
tree | 5ab3d6ebc1b2efe5cac2020cd9e089570245d361 /lib | |
parent | a44c0319c286c526f489122b785c89bbf5845782 (diff) | |
download | gitano-ea45bb9535fceea9c9feebde0360c594fc985fe1.tar.gz |
Move post-push dangling-HEAD check to post-receive hook
The smart-http interface starts http-backend which calls receive-pack.
Unfortunately we were performing the dangling-HEAD check
after calling receive-pack ourselves,
so when using smart-http we weren't performing the check.
By moving this into the post-receive hook
the check can be performed in smart-http too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/command.lua | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua index 3f433ca..317d32a 100644 --- a/lib/gitano/command.lua +++ b/lib/gitano/command.lua @@ -305,14 +305,7 @@ end local function builtin_receive_pack_run(config, repo, cmdline, env) local cmdcopy = {"receive-pack", env=env} for i = 2, #cmdline do cmdcopy[i] = cmdline[i] end - local how, why = repo:git_command(cmdcopy) - -- Check that HEAD is now resolvable in the repo - if how == "exit" and why == 0 and not repo.git:get("HEAD") then - log.warn("") - log.warn("HEAD remains dangling") - log.warn("") - end - return how, why + return repo:git_command(cmdcopy) end assert(register_cmd("git-receive-pack", nil, nil, |