avoid importing Git into module used by Setup
That would have needed Setup-Depends to include unix and other libraries.
This commit is contained in:
parent
55a9a58e1e
commit
6cba1950f2
3 changed files with 4 additions and 6 deletions
|
@ -141,7 +141,7 @@ fixupUnusualRepos r@(Repo { location = l@(Local { worktree = Just w, gitdir = d
|
|||
| coreSymlinks c = r { location = l { gitdir = dotgit } }
|
||||
| otherwise = r
|
||||
|
||||
notnoannex = isNothing <$> noAnnexFileContent r
|
||||
notnoannex = isNothing <$> noAnnexFileContent (repoWorkTree r)
|
||||
fixupUnusualRepos r _ = return r
|
||||
|
||||
needsSubmoduleFixup :: Repo -> Bool
|
||||
|
|
|
@ -53,7 +53,7 @@ import qualified Utility.LockFile.Posix as Posix
|
|||
#endif
|
||||
|
||||
checkCanInitialize :: Annex a -> Annex a
|
||||
checkCanInitialize a = inRepo noAnnexFileContent >>= \case
|
||||
checkCanInitialize a = inRepo (noAnnexFileContent . repoWorkTree) >>= \case
|
||||
Nothing -> a
|
||||
Just noannexmsg -> do
|
||||
warning "Initialization prevented by .noannex file (remove the file to override)"
|
||||
|
|
|
@ -13,8 +13,6 @@ import Common
|
|||
import Utility.Tmp
|
||||
import Utility.FreeDesktop
|
||||
|
||||
import Git
|
||||
|
||||
{- ~/.config/git-annex/file -}
|
||||
userConfigFile :: FilePath -> IO FilePath
|
||||
userConfigFile file = do
|
||||
|
@ -86,7 +84,7 @@ cannotFindProgram = do
|
|||
|
||||
{- A .noannex file in a git repository prevents git-annex from
|
||||
- initializing that repository.. The content of the file is returned. -}
|
||||
noAnnexFileContent :: Repo -> IO (Maybe String)
|
||||
noAnnexFileContent r = case Git.repoWorkTree r of
|
||||
noAnnexFileContent :: Maybe FilePath -> IO (Maybe String)
|
||||
noAnnexFileContent repoworktree = case repoworktree of
|
||||
Nothing -> return Nothing
|
||||
Just wt -> catchMaybeIO (readFile (wt </> ".noannex"))
|
||||
|
|
Loading…
Reference in a new issue