From 5c7d1b027916ce3fc207329f926041d2bcad3bcd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Nov 2010 13:55:38 -0400 Subject: [PATCH] Fix `git annex add ../foo` (when ran in a subdir of the repo). There was no reason for Git.relative to be used here. --- Backend.hs | 14 ++++++-------- debian/changelog | 6 ++++++ doc/bugs/dotdot_problem.mdwn | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Backend.hs b/Backend.hs index 2f0f71d749..f24347ca8d 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. -} diff --git a/debian/changelog b/debian/changelog index 252d9ae45b..2a8871c30e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (0.08) UNRELEASED; urgency=low + + * Fix `git annex add ../foo` (when ran in a subdir of the repo). + + -- Joey Hess Wed, 17 Nov 2010 13:54:49 -0400 + git-annex (0.07) unstable; urgency=low * find: New subcommand. diff --git a/doc/bugs/dotdot_problem.mdwn b/doc/bugs/dotdot_problem.mdwn index 9d247a9c09..cbefd5dae5 100644 --- a/doc/bugs/dotdot_problem.mdwn +++ b/doc/bugs/dotdot_problem.mdwn @@ -1,2 +1,4 @@ cannot "git annex ../foo" (GitRepo.relative is buggy and git-ls-files also refuses w/o --full-name, which would need other changes) + +[[done]]