diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-12-19 13:36:40 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-12-19 13:36:40 -0400 |
commit | fb4be5f9b2d5794cb45f8c335ae8de5700947241 (patch) | |
tree | 86c0c5caff039a32404df29260783ba4c4119258 /Command/Status.hs | |
parent | ff32fb971708f5351c8c23a8fd1e0d59f48fe894 (diff) |
status: On crippled filesystems, was displaying M for all annexed files that were present. Probably caused by a change to what git status displays in this situation. Fixed by treating files git thinks are modified the same as typechanged files.
Diffstat (limited to 'Command/Status.hs')
-rw-r--r-- | Command/Status.hs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Command/Status.hs b/Command/Status.hs index 35195fec6..3feea7cb4 100644 --- a/Command/Status.hs +++ b/Command/Status.hs @@ -46,10 +46,19 @@ displayStatus s = do unlessM (showFullJSON [("status", [c]), ("file", f)]) $ liftIO $ putStrLn $ [c] ++ " " ++ f --- Git thinks that present direct mode files are typechanged; --- check their content to see if they are modified or not. +-- Git thinks that present direct mode files are typechanged. +-- (On crippled filesystems, git instead thinks they're modified.) +-- Check their content to see if they are modified or not. statusDirect :: Status -> Annex (Maybe Status) -statusDirect (TypeChanged t) = do +statusDirect (TypeChanged t) = statusDirect' t +statusDirect s@(Modified t) = ifM crippledFileSystem + ( statusDirect' t + , pure (Just s) + ) +statusDirect s = pure (Just s) + +statusDirect' :: TopFilePath -> Annex (Maybe Status) +statusDirect' t = do absf <- fromRepo $ fromTopFilePath t f <- liftIO $ relPathCwdToFile absf v <- liftIO (catchMaybeIO $ getFileStatus f) @@ -65,7 +74,6 @@ statusDirect (TypeChanged t) = do , return $ Just $ Modified t ) checkkey f _ Nothing = Just <$> checkNew f t -statusDirect s = pure (Just s) checkNew :: FilePath -> TopFilePath -> Annex Status checkNew f t = ifM (isJust <$> catObjectDetails (Git.Ref.fileRef f)) |