diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-01-06 21:10:01 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-01-06 21:10:01 -0400 |
commit | b68a9a8a4d4380afb7e89041741d957bcec3b0c3 (patch) | |
tree | 19c18250efe6abc67cbdc284a830eeb34ae236d1 | |
parent | 6be8289158fd30d972ac22766452e7c9dc809e6f (diff) | |
parent | 59803f1595f16a53d789b98b8239b8e9afe7957f (diff) |
Merge branch 'master' into relativepaths
-rw-r--r-- | Annex/View.hs | 8 | ||||
-rw-r--r-- | Command/View.hs | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Annex/View.hs b/Annex/View.hs index 4cbf274aa..e148203c2 100644 --- a/Annex/View.hs +++ b/Annex/View.hs @@ -340,8 +340,9 @@ applyView' mkviewedfile getfilemetadata view = do genViewBranch view $ do uh <- inRepo Git.UpdateIndex.startUpdateIndex hasher <- inRepo hashObjectStart - forM_ l $ \f -> - go uh hasher f =<< Backend.lookupFile f + forM_ l $ \f -> do + relf <- getTopFilePath <$> inRepo (toTopFilePath f) + go uh hasher relf =<< Backend.lookupFile f liftIO $ do hashObjectStop hasher void $ stopUpdateIndex uh @@ -352,7 +353,8 @@ applyView' mkviewedfile getfilemetadata view = do metadata <- getCurrentMetaData k let metadata' = getfilemetadata f `unionMetaData` metadata forM_ (genviewedfiles f metadata') $ \fv -> do - stagesymlink uh hasher fv =<< inRepo (gitAnnexLink fv k) + f' <- fromRepo $ fromTopFilePath $ asTopFilePath fv + stagesymlink uh hasher f' =<< inRepo (gitAnnexLink f' k) go uh hasher f Nothing | "." `isPrefixOf` f = do s <- liftIO $ getSymbolicLinkStatus f diff --git a/Command/View.hs b/Command/View.hs index bfe030e23..ae8fe824e 100644 --- a/Command/View.hs +++ b/Command/View.hs @@ -53,10 +53,8 @@ mkView params = go =<< inRepo Git.Branch.current checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup checkoutViewBranch view mkbranch = do - oldcwd <- liftIO getCurrentDirectory + here <- liftIO getCurrentDirectory - {- Change to top of repository before creating view branch. -} - liftIO . setCurrentDirectory =<< fromRepo Git.repoPath branch <- mkbranch view showOutput @@ -68,9 +66,9 @@ checkoutViewBranch view mkbranch = do setView view {- A git repo can easily have empty directories in it, - and this pollutes the view, so remove them. -} - liftIO $ removeemptydirs "." - unlessM (liftIO $ doesDirectoryExist oldcwd) $ do - top <- fromRepo Git.repoPath + top <- fromRepo Git.repoPath + liftIO $ removeemptydirs top + unlessM (liftIO $ doesDirectoryExist here) $ do showLongNote (cwdmissing top) return ok where |