aboutsummaryrefslogtreecommitdiff
path: root/Command/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 /Command/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 'Command/View.hs')
-rw-r--r--Command/View.hs10
1 files changed, 4 insertions, 6 deletions
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