summaryrefslogtreecommitdiff
path: root/Command/Lock.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Lock.hs')
-rw-r--r--Command/Lock.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Command/Lock.hs b/Command/Lock.hs
index 1be35d612..955749e93 100644
--- a/Command/Lock.hs
+++ b/Command/Lock.hs
@@ -45,12 +45,6 @@ perform file = do
isLocked :: FilePath -> Annex Bool
isLocked file = do
g <- Annex.gitRepo
- changed <- typechanged g Nothing
- changedCached <- typechanged g $ Just "--cached"
+ typechanged <- liftIO $ Git.typeChangedFiles g file
s <- liftIO $ getSymbolicLinkStatus file
- return $ null (changed++changedCached) || isSymbolicLink s
- where
- typechanged g Nothing = typechanged' g params
- typechanged g (Just param) = typechanged' g $ params++[param]
- typechanged' g p = liftIO $ Git.pipeRead g $ p++[file]
- params = ["diff", "--name-only", "--diff-filter=T"]
+ return $ (not $ elem file typechanged) || isSymbolicLink s