2017-02-17 19:21:39 +00:00
|
|
|
{- git-annex UpdateIntead emulation
|
|
|
|
-
|
|
|
|
- Copyright 2017 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
2019-03-13 19:48:14 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2017-02-17 19:21:39 +00:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Annex.UpdateInstead where
|
|
|
|
|
|
|
|
import qualified Annex
|
|
|
|
import Annex.Common
|
|
|
|
import Annex.AdjustedBranch
|
|
|
|
import Git.Branch
|
|
|
|
import Git.ConfigTypes
|
|
|
|
|
2019-08-26 19:52:19 +00:00
|
|
|
{- receive.denyCurrentBranch=updateInstead does not work
|
|
|
|
- when an adjusted branch is checked out, so must be emulated. -}
|
2017-02-17 19:21:39 +00:00
|
|
|
needUpdateInsteadEmulation :: Annex Bool
|
2019-08-26 19:52:19 +00:00
|
|
|
needUpdateInsteadEmulation = updateinsteadset <&&> isadjusted
|
2017-02-17 19:21:39 +00:00
|
|
|
where
|
|
|
|
updateinsteadset = (== UpdateInstead) . receiveDenyCurrentBranch
|
|
|
|
<$> Annex.getGitConfig
|
2019-08-30 17:54:57 +00:00
|
|
|
isadjusted = (maybe False (isJust . getAdjustment) <$> inRepo Git.Branch.current)
|