summaryrefslogtreecommitdiff
path: root/Backend.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-17 13:55:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-17 13:55:38 -0400
commit5c7d1b027916ce3fc207329f926041d2bcad3bcd (patch)
tree7d9d3e4f3ac97c688f6ac61ae8ff665f6af030d5 /Backend.hs
parentab55689164a2fa29af61bce692cfe5df2739b790 (diff)
Fix `git annex add ../foo` (when ran in a subdir of the repo).
There was no reason for Git.relative to be used here.
Diffstat (limited to 'Backend.hs')
-rw-r--r--Backend.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/Backend.hs b/Backend.hs
index 2f0f71d74..f24347ca8 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -79,17 +79,15 @@ maybeLookupBackendName bs s =
{- Attempts to store a file in one of the backends. -}
storeFileKey :: FilePath -> Maybe Backend -> Annex (Maybe (Key, Backend))
storeFileKey file trybackend = do
- g <- Annex.gitRepo
- let relfile = Git.relative g file
bs <- list
let bs' = case trybackend of
Nothing -> bs
Just backend -> backend:bs
- storeFileKey' bs' file relfile
-storeFileKey' :: [Backend] -> FilePath -> FilePath -> Annex (Maybe (Key, Backend))
-storeFileKey' [] _ _ = return Nothing
-storeFileKey' (b:bs) file relfile = do
- result <- (Internals.getKey b) relfile
+ storeFileKey' bs' file
+storeFileKey' :: [Backend] -> FilePath -> Annex (Maybe (Key, Backend))
+storeFileKey' [] _ = return Nothing
+storeFileKey' (b:bs) file = do
+ result <- (Internals.getKey b) file
case result of
Nothing -> nextbackend
Just key -> do
@@ -98,7 +96,7 @@ storeFileKey' (b:bs) file relfile = do
then nextbackend
else return $ Just (key, b)
where
- nextbackend = storeFileKey' bs file relfile
+ nextbackend = storeFileKey' bs file
{- Attempts to retrieve an key from one of the backends, saving it to
- a specified location. -}