From 992eb6d6931cfc2ca8da0fe2d25e58742ce8cd77 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 29 Dec 2012 14:45:19 -0400 Subject: convert notBareRepo to a CommandCheck This avoids some small overhead by only running the check once per command; it also ensures that, even if the command doesn't find anything to run on, it still fails to run when in a bare repo. --- Command/Import.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Command/Import.hs') diff --git a/Command/Import.hs b/Command/Import.hs index fc1bf5b4b..e8e839e4f 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -13,14 +13,14 @@ import qualified Annex import qualified Command.Add def :: [Command] -def = [notDirect $ command "import" paramPaths seek +def = [notDirect $ notBareRepo $ command "import" paramPaths seek "move and add files from outside git working copy"] seek :: [CommandSeek] seek = [withPathContents start] start :: (FilePath, FilePath) -> CommandStart -start (srcfile, destfile) = notBareRepo $ +start (srcfile, destfile) = ifM (liftIO $ isRegularFile <$> getSymbolicLinkStatus srcfile) ( do showStart "import" destfile -- cgit v1.2.3