From 12b45d3b892ba58c5a75930a097f1469ec8fd466 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Feb 2023 13:49:16 -0400 Subject: [PATCH] use isBareRepo The advantage over Git.Config.isBare is that it avoids a string comparison and a map lookup. Sponsored-by: Noam Kremen on Patreon --- Database/Keys.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Database/Keys.hs b/Database/Keys.hs index 9e1043edae..9f78578c12 100644 --- a/Database/Keys.hs +++ b/Database/Keys.hs @@ -52,7 +52,7 @@ import Git.Sha import Git.CatFile import Git.Branch (writeTreeQuiet, update') import qualified Git.Ref -import qualified Git.Config +import Config import Config.Smudge import qualified Utility.RawFilePath as R @@ -176,7 +176,7 @@ getAssociatedFiles k = emptyWhenBare $ runReaderIO AssociatedTable $ - in a bare repository, but it might happen if a non-bare repo got - converted to bare. -} emptyWhenBare :: Annex [a] -> Annex [a] -emptyWhenBare a = ifM (Git.Config.isBare <$> gitRepo) +emptyWhenBare a = ifM isBareRepo ( return [] , a ) @@ -261,7 +261,7 @@ isInodeKnown i s = or <$> runReaderIO ContentTable - is an associated file. -} reconcileStaged :: Bool -> H.DbQueue -> Annex DbTablesChanged -reconcileStaged dbisnew qh = ifM (Git.Config.isBare <$> gitRepo) +reconcileStaged dbisnew qh = ifM isBareRepo ( return mempty , do gitindex <- inRepo currentIndexFile