This repository was archived by the owner on Jun 9, 2019. It is now read-only.
File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ gitBranchesContain d ref = do
82
82
83
83
84
84
85
- -- | returns @[(path, (url, key ))]@
85
+ -- | returns @[(path, (url, name ))]@
86
86
--
87
87
-- may throw exception
88
88
getModules :: FilePath -> GitRef -> Sh [(Text , (Text , Text ))]
@@ -99,8 +99,9 @@ getModules d ref = do
99
99
, let (_,key1) = T. break (== ' .' ) (T. init key')
100
100
]
101
101
102
- ms' = [ (path', (url, k ))
102
+ ms' = [ (path', (url, name ))
103
103
| es@ ((k,_): _) <- groupBy ((==) `on` fst ) ms
104
+ , let (_,name) = T. breakOnEnd " /" k
104
105
, let props = map snd es
105
106
, let url = fromMaybe (error " getModules1" ) (lookup " url" props)
106
107
, let path' = fromMaybe (error " getModules2" ) (lookup " path" props)
Original file line number Diff line number Diff line change @@ -35,16 +35,21 @@ main = do
35
35
echo $ " Submodule update(s) detected in " <> cid <> " :"
36
36
37
37
(_, msg) <- gitCatCommit dir cid
38
+ let msg' = T. toLower msg
38
39
39
- unless (" submodule" `T.isInfixOf` msg) $ do
40
+ unless (" submodule" `T.isInfixOf` msg' ) $ do
40
41
echo " *FAIL* commit message does not contain magic 'submodule' word"
41
42
quietExit 1
42
43
43
44
modMapping <- getModules dir ref
44
45
forM_ smDeltas $ \ (smPath,smCid) -> do
45
46
echo $ " " <> smPath <> " => " <> smCid
46
- (smUrl,_) <- maybe (fail " failed to lookup repo-url" ) return $
47
- lookup smPath modMapping
47
+ (smUrl,name) <- maybe (fail " failed to lookup repo-url" ) return $
48
+ lookup smPath modMapping
49
+
50
+ unless (T. toLower name `T.isInfixOf` msg') $ do
51
+ echo $ " *FAIL* commit message does not mention '" <> name <> " '"
52
+ quietExit 1
48
53
49
54
if not (" ." `T.isPrefixOf` smUrl)
50
55
then echo $ " skipping non-relative Git url (" <> smUrl <> " )"
You can’t perform that action at this time.
0 commit comments