diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-02-17 14:04:43 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-02-17 14:04:43 -0400 |
commit | 615053c624b357520ef01db60c58e60d848a44bd (patch) | |
tree | 90bcd7299da5767ddab3eaabb335c55b9a13a9be /Annex | |
parent | 5b64144c2fb989f9799c1ec328b442b504b1d10f (diff) |
post-recive hook to make updateInstead work in direct mode and adjusted branches
* Added post-recieve hook, which makes updateInstead work with direct
mode and adjusted branches.
* init: Set up the post-receive hook.
This commit was sponsored by Fernando Jimenez on Patreon.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Hook.hs | 5 | ||||
-rw-r--r-- | Annex/Init.hs | 4 | ||||
-rw-r--r-- | Annex/Perms.hs | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/Annex/Hook.hs b/Annex/Hook.hs index a073c2598..b53914505 100644 --- a/Annex/Hook.hs +++ b/Annex/Hook.hs @@ -4,7 +4,7 @@ - not change, otherwise removing old hooks using an old version of - the script would fail. - - - Copyright 2013-2014 Joey Hess <id@joeyh.name> + - Copyright 2013-2017 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} @@ -22,6 +22,9 @@ import qualified Data.Map as M preCommitHook :: Git.Hook preCommitHook = Git.Hook "pre-commit" (mkHookScript "git annex pre-commit .") +postReceiveHook :: Git.Hook +postReceiveHook = Git.Hook "post-receive" (mkHookScript "git annex post-receive") + preCommitAnnexHook :: Git.Hook preCommitAnnexHook = Git.Hook "pre-commit-annex" "" diff --git a/Annex/Init.hs b/Annex/Init.hs index 74274ad7f..3427c0049 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -83,8 +83,9 @@ initialize' mversion = do checkLockSupport checkFifoSupport checkCrippledFileSystem - unlessM isBareRepo $ + unlessM isBareRepo $ do hookWrite preCommitHook + hookWrite postReceiveHook setDifferences unlessM (isJust <$> getVersion) $ setVersion (fromMaybe defaultVersion mversion) @@ -114,6 +115,7 @@ initialize' mversion = do uninitialize :: Annex () uninitialize = do hookUnWrite preCommitHook + hookUnWrite postReceiveHook removeRepoUUID removeVersion diff --git a/Annex/Perms.hs b/Annex/Perms.hs index 80eb71f37..1ce342911 100644 --- a/Annex/Perms.hs +++ b/Annex/Perms.hs @@ -24,7 +24,7 @@ module Annex.Perms ( import Annex.Common import Utility.FileMode -import Git.SharedRepository +import Git.ConfigTypes import qualified Annex import Config |