From ca1a3caaa88dcd23187ee5446ccd5057e69a3212 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Mar 2019 13:34:57 -0400 Subject: [PATCH] refactor --- Command/Import.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Command/Import.hs b/Command/Import.hs index 4e65b1ad5d..a51c1ecb7b 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -102,12 +102,14 @@ seek o@(LocalImportOptions {}) = allowConcurrentOutput $ do largematcher <- largeFilesMatcher (commandAction . startLocal largematcher (duplicateMode o)) `withPathContents` importFiles o -seek o@(RemoteImportOptions {}) = do +seek o@(RemoteImportOptions {}) = allowConcurrentOutput $ do r <- getParsed (importFromRemote o) subdir <- maybe (pure Nothing) (Just <$$> inRepo . toTopFilePath) (importToSubDir o) + unlessM (Remote.isImportSupported remote) $ + giveup "That remote does not support imports." seekRemote r (importToBranch o) subdir startLocal :: GetFileMatcher -> DuplicateMode -> (FilePath, FilePath) -> CommandStart @@ -245,9 +247,7 @@ verifyExisting key destfile (yes, no) = do (const yes) no seekRemote :: Remote -> Branch -> Maybe TopFilePath -> CommandSeek -seekRemote remote branch msubdir = allowConcurrentOutput $ do - unlessM (Remote.isImportSupported remote) $ - giveup "That remote does not support imports." +seekRemote remote branch msubdir = do importtreeconfig <- case msubdir of Nothing -> return ImportTree Just subdir ->