Skip to content

Commit 14f68be

Browse files
committed
main is the new master branch
1 parent 0df82be commit 14f68be

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,3 @@ With `stack exec -- gitallup-exe --help` to see this text:
2626
updating, comma separated
2727
-v,--verbose Verbose output?
2828
~~~~
29-
30-
## Run tests
31-
32-
`stack test`

hie.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cradle:
2+
stack:

src/Git.hs

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ where
1111

1212
import qualified Data.ByteString.Lazy as B
1313
import qualified Data.ByteString.Lazy.Char8 as C8
14-
import RIO
14+
15+
import RIO ( ExitCode
16+
( ExitFailure
17+
, ExitSuccess
18+
)
19+
, RIO
20+
)
1521
import RIO.Process ( proc
1622
, readProcess
1723
)
@@ -42,9 +48,12 @@ gitResetHard branch =
4248
>>= _processResult
4349

4450
isMasterBranch :: B.ByteString -> Bool
45-
isMasterBranch s = "* master" `elem` branches
51+
isMasterBranch s = any (`elem` _masterBranches) branches
4652
where branches = lines . C8.unpack $ s
4753

4854
_processResult :: ReadProcessResult -> RIO App ()
4955
_processResult (ExitSuccess , out, _ ) = logSuc (C8.unpack out)
5056
_processResult (ExitFailure code, _ , err) = logErr code (C8.unpack err)
57+
58+
_masterBranches :: [String]
59+
_masterBranches = ["* master", "* main"]

0 commit comments

Comments
 (0)