deal with dos path separators
This commit is contained in:
		
					parent
					
						
							
								167bee746c
							
						
					
				
			
			
				commit
				
					
						838b984797
					
				
			
		
					 1 changed files with 6 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								Annex/Journal.hs
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										10
									
								
								Annex/Journal.hs
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							| 
						 | 
					@ -66,14 +66,16 @@ journalDirty = not . null <$> getJournalFiles
 | 
				
			||||||
journalFile :: FilePath -> Git.Repo -> FilePath
 | 
					journalFile :: FilePath -> Git.Repo -> FilePath
 | 
				
			||||||
journalFile file repo = gitAnnexJournalDir repo </> concatMap mangle file
 | 
					journalFile file repo = gitAnnexJournalDir repo </> concatMap mangle file
 | 
				
			||||||
  where
 | 
					  where
 | 
				
			||||||
	mangle '/' = "_"
 | 
						mangle c
 | 
				
			||||||
	mangle '_' = "__"
 | 
							| c == pathSeparator = "_"
 | 
				
			||||||
	mangle c = [c]
 | 
							| c == '_' = '__'
 | 
				
			||||||
 | 
							| otherwise = c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{- Converts a journal file (relative to the journal dir) back to the
 | 
					{- Converts a journal file (relative to the journal dir) back to the
 | 
				
			||||||
 - filename on the branch. -}
 | 
					 - filename on the branch. -}
 | 
				
			||||||
fileJournal :: FilePath -> FilePath
 | 
					fileJournal :: FilePath -> FilePath
 | 
				
			||||||
fileJournal = replace "//" "_" . replace "_" "/"
 | 
					fileJournal = replace [pathSeparator, pathSeparator] "_" .
 | 
				
			||||||
 | 
						replace "_" [pathSeparator]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{- Runs an action that modifies the journal, using locking to avoid
 | 
					{- Runs an action that modifies the journal, using locking to avoid
 | 
				
			||||||
 - contention with other git-annex processes. -}
 | 
					 - contention with other git-annex processes. -}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue