summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Sync.hs2
-rw-r--r--Utility/Monad.hs8
-rw-r--r--doc/distributed_version_control.mdwn2
3 files changed, 10 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 445a37137..e5884cc4a 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -31,7 +31,7 @@ def = [command "sync" (paramOptional (paramRepeating paramRemote))
-- syncing involves several operations, any of which can independently fail
seek :: CommandSeek
seek rs = do
- !branch <- fromMaybe nobranch <$> inRepo (Git.Branch.current)
+ !branch <- fromMaybe nobranch <$> inRepo Git.Branch.current
remotes <- syncRemotes rs
return $ concat $
[ [ commit ]
diff --git a/Utility/Monad.hs b/Utility/Monad.hs
index 0d1675fa4..9e2a16e8c 100644
--- a/Utility/Monad.hs
+++ b/Utility/Monad.hs
@@ -28,3 +28,11 @@ anyM p = liftM isJust . firstM p
{- Runs an action on values from a list until it succeeds. -}
untilTrue :: (Monad m) => [a] -> (a -> m Bool) -> m Bool
untilTrue = flip anyM
+
+{- Runs a monadic action, passing its value to an observer
+ - before returning it. -}
+observe :: (Monad m) => (a -> m b) -> m a -> m a
+observe observer a = do
+ r <- a
+ _ <- observer r
+ return r
diff --git a/doc/distributed_version_control.mdwn b/doc/distributed_version_control.mdwn
index e7c858c69..ccf82b91c 100644
--- a/doc/distributed_version_control.mdwn
+++ b/doc/distributed_version_control.mdwn
@@ -12,7 +12,7 @@ and can copy it to or from other repositories. [[Location_tracking]]
information is committed to git, to let repositories inform other
repositories what file contents they have available.
---
+---
The [[walkthrough]] shows how to create a distributed set of git-annex
repositories with no central repository.