diff options
Diffstat (limited to 'Command')
-rw-r--r-- | Command/AddUrl.hs | 17 | ||||
-rw-r--r-- | Command/ReKey.hs | 2 | ||||
-rw-r--r-- | Command/Schedule.hs | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index e32ceb568..e49d2727c 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -340,13 +340,18 @@ cleanup :: UUID -> URLString -> FilePath -> Key -> Maybe FilePath -> Annex () cleanup u url file key mtmp = case mtmp of Nothing -> go Just tmp -> do + -- Move to final location for large file check. + liftIO $ renameFile tmp file largematcher <- largeFilesMatcher - ifM (checkFileMatcher largematcher file) - ( go - , do - liftIO $ renameFile tmp file - void $ Command.Add.addSmall file - ) + large <- checkFileMatcher largematcher file + if large + then do + -- Move back to tmp because addAnnexedFile + -- needs the file in a different location + -- than the work tree file. + liftIO $ renameFile file tmp + go + else void $ Command.Add.addSmall file where go = do maybeShowJSON $ JSONChunk [("key", key2file key)] diff --git a/Command/ReKey.hs b/Command/ReKey.hs index 51f9f6fe1..33734ebe7 100644 --- a/Command/ReKey.hs +++ b/Command/ReKey.hs @@ -44,7 +44,7 @@ perform :: FilePath -> Key -> Key -> CommandPerform perform file oldkey newkey = do ifM (inAnnex oldkey) ( unlessM (linkKey file oldkey newkey) $ - error "failed" + giveup "failed" , unlessM (Annex.getState Annex.force) $ giveup $ file ++ " is not available (use --force to override)" ) diff --git a/Command/Schedule.hs b/Command/Schedule.hs index 5cc8b37bf..c9d4f915f 100644 --- a/Command/Schedule.hs +++ b/Command/Schedule.hs @@ -29,7 +29,7 @@ start = parse where parse (name:[]) = go name performGet parse (name:expr:[]) = go name $ \uuid -> do - showStart "schedile" name + showStart "schedule" name performSet expr uuid parse _ = giveup "Specify a repository." |