update unicode FilePath handling
Based on http://hackage.haskell.org/trac/ghc/ticket/3307 , whether FilePath contains decoded unicode varies by OS. So, add a configure check for it. Also, renamed showFile to filePathToString
This commit is contained in:
parent
285fb2bb08
commit
5a50a7cf13
11 changed files with 34 additions and 16 deletions
|
@ -25,5 +25,5 @@ seek = [withFilesInGit start]
|
|||
start :: CommandStartString
|
||||
start file = isAnnexed file $ \(key, _) -> do
|
||||
exists <- inAnnex key
|
||||
when exists $ liftIO $ putStrLn $ showFile file
|
||||
when exists $ liftIO $ putStrLn $ filePathToString file
|
||||
return Nothing
|
||||
|
|
|
@ -33,7 +33,7 @@ perform pair@(file, _) = do
|
|||
ok <- doCommand $ Command.Add.start pair
|
||||
if ok
|
||||
then return $ Just $ cleanup file
|
||||
else error $ "failed to add " ++ showFile file ++ "; canceling commit"
|
||||
else error $ "failed to add " ++ filePathToString file ++ "; canceling commit"
|
||||
|
||||
cleanup :: FilePath -> CommandCleanup
|
||||
cleanup file = do
|
||||
|
|
|
@ -68,7 +68,7 @@ checkUnused = do
|
|||
dropmsg = ["(To remove unwanted data: git-annex dropunused NUMBER)"]
|
||||
|
||||
table l = [" NUMBER KEY"] ++ map cols l
|
||||
cols (n,k) = " " ++ pad 6 (show n) ++ " " ++ (showFile . show) k
|
||||
cols (n,k) = " " ++ pad 6 (show n) ++ " " ++ (filePathToString . show) k
|
||||
pad n s = s ++ replicate (n - length s) ' '
|
||||
|
||||
number :: Int -> [a] -> [(Int, a)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue