summaryrefslogtreecommitdiff
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
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..
-rw-r--r--Remote/Directory.hs7
-rw-r--r--debian/changelog2
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 <joeyh@debian.org> Thu, 02 May 2013 20:39:19 -0400