11import * as fs from "fs" ;
2+ import * as os from "os" ;
23import * as path from "path" ;
34
45import * as core from "@actions/core" ;
@@ -376,7 +377,9 @@ test("getFileOidsUnderPath throws on unexpected output format", async (t) => {
376377} ) ;
377378
378379test ( "getGitVersionOrThrow returns version for valid git output" , async ( t ) => {
379- sinon . stub ( gitUtils as any , "runGitCommand" ) . resolves ( "git version 2.40.0" ) ;
380+ sinon
381+ . stub ( gitUtils as any , "runGitCommand" )
382+ . resolves ( `git version 2.40.0${ os . EOL } ` ) ;
380383
381384const version = await gitUtils . getGitVersionOrThrow ( ) ;
382385t . is ( version . truncatedVersion , "2.40.0" ) ;
@@ -403,7 +406,7 @@ test("getGitVersionOrThrow handles Windows-style git output", async (t) => {
403406. resolves ( "git version 2.40.0.windows.1" ) ;
404407
405408const version = await gitUtils . getGitVersionOrThrow ( ) ;
406- //Should extract just the major.minor.patch portion
409+ //The truncated version should contain just the major.minor.patch portion
407410t . is ( version . truncatedVersion , "2.40.0" ) ;
408411t . is ( version . fullVersion , "2.40.0.windows.1" ) ;
409412} ) ;