diff options
author | Joey Hess <id@joeyh.name> | 2013-05-12 15:37:32 -0500 |
---|---|---|
committer | Joey Hess <id@joeyh.name> | 2013-05-12 15:37:32 -0500 |
commit | f1a0b394f63cd598c91cffab1c956dd813cc5701 (patch) | |
tree | 4f728aaa7de2700134f7e12d69e3664802d9c152 /Annex/Journal.hs | |
parent | 4763094eb17e6b6cf984f047e7f00fd10a056f00 (diff) |
deal with dos path separators
Diffstat (limited to 'Annex/Journal.hs')
-rwxr-xr-x[-rw-r--r--] | Annex/Journal.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Annex/Journal.hs b/Annex/Journal.hs index f86d03cf6..9f4d29599 100644..100755 --- a/Annex/Journal.hs +++ b/Annex/Journal.hs @@ -66,14 +66,16 @@ journalDirty = not . null <$> getJournalFiles journalFile :: FilePath -> Git.Repo -> FilePath journalFile file repo = gitAnnexJournalDir repo </> concatMap mangle file where - mangle '/' = "_" - mangle '_' = "__" - mangle c = [c] + mangle c + | c == pathSeparator = "_" + | c == '_' = '__' + | otherwise = c {- Converts a journal file (relative to the journal dir) back to the - filename on the branch. -} fileJournal :: FilePath -> FilePath -fileJournal = replace "//" "_" . replace "_" "/" +fileJournal = replace [pathSeparator, pathSeparator] "_" . + replace "_" [pathSeparator] {- Runs an action that modifies the journal, using locking to avoid - contention with other git-annex processes. -} |