From 99b509572d250b2a12120335901bdc3a6cdfcb81 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Sep 2019 14:41:51 -0400 Subject: [PATCH] post-receive hook updateInstead emulation cleanup The code is only needed because for a long time, git-annex didn't install hooks in repos on crippled filesystems. Now it does, and they work at least on FAT (where all files are executable) and Windows. It would be possible to remove this code in v8 simply by re-installing the hooks. --- Command/Sync.hs | 5 +++-- doc/git-annex-post-receive.mdwn | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Command/Sync.hs b/Command/Sync.hs index 0e941a4300..d35986c0f3 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -458,8 +458,9 @@ pushRemote o remote (Just branch, _) = stopUnless (pure (pushOption o) <&&> need | remoteAnnexReadOnly gc = return False | not (remoteAnnexPush gc) = return False | otherwise = anyM (newer remote) [syncBranch branch, Annex.Branch.name] - -- Do updateInstead emulation for remotes on eg removable drives - -- formatted FAT, where the post-receive hook won't run. + -- Older remotes on crippled filesystems may not have a + -- post-receive hook set up, so when updateInstead emulation + -- is needed, run post-receive manually. postpushupdate repo = case Git.repoWorkTree repo of Nothing -> return True Just wt -> ifM needemulation diff --git a/doc/git-annex-post-receive.mdwn b/doc/git-annex-post-receive.mdwn index 6d71681caf..a5f4e6c08d 100644 --- a/doc/git-annex-post-receive.mdwn +++ b/doc/git-annex-post-receive.mdwn @@ -13,7 +13,7 @@ automatically creates a post-receive hook using this. When a repository is configured with receive.denyCurrentBranch=updateInstead, pushes to the repository update its work tree. However, that does not work -for repositories that use have an adjusted branch checked +for repositories that have an adjusted branch checked out. The hook updates the work tree when run in such a repository, the same as running `git-annex merge` would.