summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-06 17:15:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-06 17:15:36 -0400
commit8ece8d39e8fff3ecef1815a7c0d7a37aa4bcb46f (patch)
tree7dda09496bc91cd74ac6a8fcb31c99f9b610b94a /Remote
parent2076989051b9a9f01e9e4264c12ca0cf953b40fc (diff)
When initializing a directory special remote with a relative path, the path is made absolute.
Using a relative path would work, until the user changed to some other directory in the repo and tried to access the remote from there..
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Directory.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index 1c81377fc..d3885e89e 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -68,13 +68,14 @@ directorySetup u c = do
-- verify configuration is sane
let dir = fromMaybe (error "Specify directory=") $
M.lookup "directory" c
- liftIO $ unlessM (doesDirectoryExist dir) $
- error $ "Directory does not exist: " ++ dir
+ absdir <- liftIO $ absPath dir
+ liftIO $ unlessM (doesDirectoryExist absdir) $
+ error $ "Directory does not exist: " ++ absdir
c' <- encryptionSetup c
-- The directory is stored in git config, not in this remote's
-- persistant state, so it can vary between hosts.
- gitConfigSpecialRemote u c' "directory" dir
+ gitConfigSpecialRemote u c' "directory" absdir
return $ M.delete "directory" c'
{- Locations to try to access a given Key in the Directory.