more RawFilePath conversion

removeFile changed to removeLink, because AFAICS it should be fine to
remove non-file things here. In particular, it's fine to remove a
symlink, since we're about to write a symlink. (removeLink does not
remove directories, so file, symlink, and unix socket are the only
possibilities.)
This commit is contained in:
Joey Hess 2020-10-30 13:07:41 -04:00
parent 8f452416f7
commit ca80c3154c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 13 additions and 13 deletions

View file

@ -285,11 +285,11 @@ bup2GitRemote :: BupRepo -> IO Git.Repo
bup2GitRemote "" = do
-- bup -r "" operates on ~/.bup
h <- myHomeDir
Git.Construct.fromAbsPath $ h </> ".bup"
Git.Construct.fromAbsPath $ toRawFilePath $ h </> ".bup"
bup2GitRemote r
| bupLocal r =
if "/" `isPrefixOf` r
then Git.Construct.fromAbsPath r
then Git.Construct.fromAbsPath (toRawFilePath r)
else giveup "please specify an absolute path"
| otherwise = Git.Construct.fromUrl $ "ssh://" ++ host ++ slash dir
where