make adding modified files work on crippled filesystems
This commit is contained in:
parent
c2b8db3e69
commit
52902c0945
3 changed files with 18 additions and 2 deletions
|
@ -31,11 +31,14 @@ import Utility.InodeCache
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [notBareRepo $ command "add" paramPaths seek "add files to annex"]
|
def = [notBareRepo $ command "add" paramPaths seek "add files to annex"]
|
||||||
|
|
||||||
{- Add acts on both files not checked into git yet, and unlocked files. -}
|
{- Add acts on both files not checked into git yet, and unlocked files.
|
||||||
|
-
|
||||||
|
- In direct mode, it acts on any files that have changed. -}
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek =
|
seek =
|
||||||
[ withFilesNotInGit start
|
[ withFilesNotInGit start
|
||||||
, withFilesUnlocked start
|
, whenNotDirect $ withFilesUnlocked start
|
||||||
|
, whenDirect $ withFilesMaybeModified start
|
||||||
]
|
]
|
||||||
|
|
||||||
{- The add subcommand annexes a file, generating a key for it using a
|
{- The add subcommand annexes a file, generating a key for it using a
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Git.LsFiles (
|
||||||
inRepo,
|
inRepo,
|
||||||
notInRepo,
|
notInRepo,
|
||||||
deleted,
|
deleted,
|
||||||
|
modified,
|
||||||
staged,
|
staged,
|
||||||
stagedNotDeleted,
|
stagedNotDeleted,
|
||||||
stagedDetails,
|
stagedDetails,
|
||||||
|
@ -46,6 +47,13 @@ deleted l repo = pipeNullSplit params repo
|
||||||
where
|
where
|
||||||
params = [Params "ls-files --deleted -z --"] ++ map File l
|
params = [Params "ls-files --deleted -z --"] ++ map File l
|
||||||
|
|
||||||
|
{- Returns a list of files in the specified locations that have been
|
||||||
|
- modified. -}
|
||||||
|
modified :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
|
||||||
|
modified l repo = pipeNullSplit params repo
|
||||||
|
where
|
||||||
|
params = [Params "ls-files --modified -z --"] ++ map File l
|
||||||
|
|
||||||
{- Returns a list of all files that are staged for commit. -}
|
{- Returns a list of all files that are staged for commit. -}
|
||||||
staged :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
|
staged :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
|
||||||
staged = staged' []
|
staged = staged' []
|
||||||
|
|
5
Seek.hs
5
Seek.hs
|
@ -88,6 +88,11 @@ withFilesUnlocked' typechanged a params = do
|
||||||
let unlockedfiles = liftIO $ filterM notSymlink typechangedfiles
|
let unlockedfiles = liftIO $ filterM notSymlink typechangedfiles
|
||||||
prepFiltered a unlockedfiles
|
prepFiltered a unlockedfiles
|
||||||
|
|
||||||
|
{- Finds files that may be modified. -}
|
||||||
|
withFilesMaybeModified :: (FilePath -> CommandStart) -> CommandSeek
|
||||||
|
withFilesMaybeModified a params =
|
||||||
|
prepFiltered a $ seekHelper LsFiles.modified params
|
||||||
|
|
||||||
withKeys :: (Key -> CommandStart) -> CommandSeek
|
withKeys :: (Key -> CommandStart) -> CommandSeek
|
||||||
withKeys a params = return $ map (a . parse) params
|
withKeys a params = return $ map (a . parse) params
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue