summaryrefslogtreecommitdiff
path: root/src/Expression.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Expression.hs')
-rw-r--r--src/Expression.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Expression.hs b/src/Expression.hs
index bf35f2a..43f859e 100644
--- a/src/Expression.hs
+++ b/src/Expression.hs
@@ -132,10 +132,14 @@ evaluateDeclaredRevision repo = \case
ts -> return $ StaticRef $ tagObject $ foldl1' sel ts
WatchedRef (TextRef ref) -> do
- watched <- watchBranch repo ref
- output <- getOutput
- outputEvent output $ TestMessage $ "watch-branch-started " <> ref
- return $ WatchedRef $ BranchRef watched
+ watchBranch repo ref >>= \case
+ Right watched -> do
+ output <- getOutput
+ outputEvent output $ TestMessage $ "watch-branch-started " <> ref
+ return $ WatchedRef $ BranchRef watched
+ Left commit -> do
+ return $ StaticRef commit
+
WatchedRef (TagRef wtPattern wtUpdate) -> do
wtChan <- watchTags repo
value <- filter (Glob.match wtPattern . T.unpack . tagTag) <$> listTags repo >>= \case