aboutsummaryrefslogtreecommitdiff
path: root/Annex/View.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 21:01:05 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 21:01:05 -0400
commit59803f1595f16a53d789b98b8239b8e9afe7957f (patch)
treea9923aeeff30e071d1445d824ff237b49f9dea88 /Annex/View.hs
parent971ed2a464a1a1e4d5e650e32390d232cd354d9d (diff)
fix view generation code to work when run in a subdirectory; no longer needs to setCurrentDirectory to top of repo
Diffstat (limited to 'Annex/View.hs')
-rw-r--r--Annex/View.hs8
1 files changed, 5 insertions, 3 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