diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-11-05 16:29:48 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-11-05 16:29:48 +0000 |
commit | ab28dd6f838cac321e7276d0aa6ffbe4d8a53a36 (patch) | |
tree | ad7d6b467a81c908844cbb46a16a6c2baac00f30 | |
parent | 2320a33f4f07498e08f2d37b4276ad75599b93d5 (diff) | |
download | gitano-ab28dd6f838cac321e7276d0aa6ffbe4d8a53a36.tar.bz2 |
Warn about dangling HEAD following a successful push
-rw-r--r-- | lib/gitano/command.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitano/command.lua b/lib/gitano/command.lua index 1b1d48b..effe734 100644 --- a/lib/gitano/command.lua +++ b/lib/gitano/command.lua @@ -221,7 +221,14 @@ local function builtin_receive_pack_run(config, repo, cmdline, env) local cmdcopy = {env=env} for i = 1, #cmdline do cmdcopy[i] = cmdline[i] end local proc = sp.spawn(cmdcopy) - return proc:wait() + local how, why = proc:wait() + -- 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 end assert(register_cmd("git-receive-pack", nil, nil, |