Do not display branches that have been merged into master
authorJoachim Breitner <mail@joachim-breitner.de>
Thu, 6 Aug 2015 15:10:41 +0000 (17:10 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Thu, 6 Aug 2015 15:10:41 +0000 (17:10 +0200)
src/Shake.hs

index 41fc9fd..dfb4bd8 100644 (file)
@@ -177,8 +177,9 @@ shakeMain = do
                 writeFileChanged out ""
             Just pattern -> do
                 Stdout branches <- git "branch" ["--list", pattern]
-                branches' <- filterM (isGitAncestor "repository" (S.start s)) (map (drop 2) $ lines branches)
-                writeFileChanged out (unlines branches')
+                branches <- filterM (isGitAncestor "repository" (S.start s)) (map (drop 2) $ lines branches)
+                branches <- filterM (\b -> not <$> isGitAncestor "repository" b "master") branches
+                writeFileChanged out (unlines branches)
 
     "graphs" ~> do
         [latest] <- readFileLines "site/out/latest.txt"