From 8ece8d39e8fff3ecef1815a7c0d7a37aa4bcb46f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 6 May 2013 17:15:36 -0400 Subject: 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.. --- Remote/Directory.hs | 7 ++++--- debian/changelog | 2 ++ 2 files changed, 6 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. diff --git a/debian/changelog b/debian/changelog index d1f8fa68e..dfd2bacb6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ git-annex (4.20130502) UNRELEASED; urgency=low * Avoid depending on regex-tdfa on mips, mipsel, and s390, where it fails to build. * direct: Fix a bug that could cause some files to be left in indirect mode. + * When initializing a directory special remote with a relative path, + the path is made absolute. -- Joey Hess Thu, 02 May 2013 20:39:19 -0400 -- cgit v1.2.3