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 } }
|
| coreSymlinks c = r { location = l { gitdir = dotgit } }
|
||||||
| otherwise = r
|
| otherwise = r
|
||||||
|
|
||||||
notnoannex = isNothing <$> noAnnexFileContent r
|
notnoannex = isNothing <$> noAnnexFileContent (repoWorkTree r)
|
||||||
fixupUnusualRepos r _ = return r
|
fixupUnusualRepos r _ = return r
|
||||||
|
|
||||||
needsSubmoduleFixup :: Repo -> Bool
|
needsSubmoduleFixup :: Repo -> Bool
|
||||||
|
|
|
@ -53,7 +53,7 @@ import qualified Utility.LockFile.Posix as Posix
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
checkCanInitialize :: Annex a -> Annex a
|
checkCanInitialize :: Annex a -> Annex a
|
||||||
checkCanInitialize a = inRepo noAnnexFileContent >>= \case
|
checkCanInitialize a = inRepo (noAnnexFileContent . repoWorkTree) >>= \case
|
||||||
Nothing -> a
|
Nothing -> a
|
||||||
Just noannexmsg -> do
|
Just noannexmsg -> do
|
||||||
warning "Initialization prevented by .noannex file (remove the file to override)"
|
warning "Initialization prevented by .noannex file (remove the file to override)"
|
||||||
|
|
|
@ -13,8 +13,6 @@ import Common
|
||||||
import Utility.Tmp
|
import Utility.Tmp
|
||||||
import Utility.FreeDesktop
|
import Utility.FreeDesktop
|
||||||
|
|
||||||
import Git
|
|
||||||
|
|
||||||
{- ~/.config/git-annex/file -}
|
{- ~/.config/git-annex/file -}
|
||||||
userConfigFile :: FilePath -> IO FilePath
|
userConfigFile :: FilePath -> IO FilePath
|
||||||
userConfigFile file = do
|
userConfigFile file = do
|
||||||
|
@ -86,7 +84,7 @@ cannotFindProgram = do
|
||||||
|
|
||||||
{- A .noannex file in a git repository prevents git-annex from
|
{- A .noannex file in a git repository prevents git-annex from
|
||||||
- initializing that repository.. The content of the file is returned. -}
|
- initializing that repository.. The content of the file is returned. -}
|
||||||
noAnnexFileContent :: Repo -> IO (Maybe String)
|
noAnnexFileContent :: Maybe FilePath -> IO (Maybe String)
|
||||||
noAnnexFileContent r = case Git.repoWorkTree r of
|
noAnnexFileContent repoworktree = case repoworktree of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just wt -> catchMaybeIO (readFile (wt </> ".noannex"))
|
Just wt -> catchMaybeIO (readFile (wt </> ".noannex"))
|
||||||
|
|
Loading…
Reference in a new issue