@@ -14,31 +14,33 @@ export async function retrieveCommitMessages(
14
14
process . chdir ( repoRoot ) ;
15
15
const fs = { promises : fsPromises , readFile, stat, readdir } ;
16
16
17
- // Retrieve the commit logs between the specified commits
17
+ const resolvedToCommit = await git . resolveRef ( { fs, dir : repoRoot , ref : toCommit } ) ;
18
+ const resolvedFromCommit = await git . resolveRef ( { fs, dir : repoRoot , ref : fromCommit } ) ;
19
+
20
+ // Retrieve the commit logs between the specified commits
18
21
const commits = await git . log ( {
19
22
fs,
20
23
dir : repoRoot ,
21
- ref : toCommit ,
24
+ ref : resolvedToCommit ,
22
25
} ) ;
23
26
24
27
const commitMessages : string [ ] = [ ] ;
25
28
let collectMessages = false ;
26
29
27
30
for ( const commit of commits ) {
28
- if ( commit . oid === toCommit ) {
31
+ if ( commit . oid === resolvedToCommit ) {
29
32
collectMessages = true ;
30
33
}
31
34
32
35
if ( collectMessages ) {
33
- // If the commit is the `fromCommit`, break the loop before adding it
34
- if ( commit . oid === fromCommit ) {
36
+ if ( commit . oid === resolvedFromCommit ) {
35
37
break ;
36
38
}
37
39
commitMessages . push ( commit . commit . message ) ;
38
40
}
39
41
}
40
42
41
- // Read and compile the regex from the specified file
43
+ // Read and compile the regex from the specified file
42
44
let regex : RegExp ;
43
45
const regexFilePath = resolve ( repoRoot , '.apextestsgitdeltarc' ) ;
44
46
try {
@@ -50,7 +52,7 @@ export async function retrieveCommitMessages(
50
52
) ;
51
53
}
52
54
53
- // Filter messages that match the regex
55
+ // Filter messages that match the regex
54
56
const matchedMessages : string [ ] = [ ] ;
55
57
commitMessages . forEach ( ( message ) => {
56
58
let match ;
0 commit comments