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.
This commit is contained in:
parent
9d19a60349
commit
35827e2705
3 changed files with 67 additions and 4 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue