@@ -31,7 +31,7 @@ describe("bundle_publish", () => {
3131 it ( "should return true when directory has changes in HEAD commit" , async ( ) => {
3232 mockedExec . exec
3333 . mockImplementationOnce ( async ( cmd , args , options ) => {
34- // diff-tree returns changed files
34+ // git log returns changed files
3535 if ( options ?. listeners ?. stdout ) {
3636 options . listeners . stdout ( Buffer . from ( "test-bundle/massdriver.yaml\ntest-bundle/src/main.tf\n" ) )
3737 }
@@ -41,15 +41,15 @@ describe("bundle_publish", () => {
4141
4242 await bundlePublish ( )
4343
44- // Verify diff-tree was called to check HEAD commit
44+ // Verify git log was called to check HEAD commit
4545 expect ( mockedExec . exec ) . toHaveBeenCalledWith (
4646 "git" ,
47- [ "diff-tree " , "--no-commit-id " , "--name-only" , "-r " , "HEAD" , "--" , "test-bundle" ] ,
47+ [ "log " , "--format= " , "--name-only" , "-1 " , "HEAD" , "--" , "test-bundle" ] ,
4848 expect . objectContaining ( {
4949 ignoreReturnCode : true ,
50- silent : true ,
5150 listeners : expect . objectContaining ( {
52- stdout : expect . any ( Function )
51+ stdout : expect . any ( Function ) ,
52+ stderr : expect . any ( Function )
5353 } )
5454 } )
5555 )
@@ -69,7 +69,7 @@ describe("bundle_publish", () => {
6969 it ( "should skip publish when no changes detected in HEAD commit" , async ( ) => {
7070 mockedExec . exec
7171 . mockImplementationOnce ( async ( cmd , args , options ) => {
72- // diff-tree returns no files (empty output)
72+ // git log returns no files (empty output)
7373 if ( options ?. listeners ?. stdout ) {
7474 options . listeners . stdout ( Buffer . from ( "" ) )
7575 }
0 commit comments