Skip to content

Commit ff84c6f

Browse files
committed
Improve comment
1 parent 948c7fb commit ff84c6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/git-utils.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from "fs";
2+
import * as os from "os";
23
import * as path from "path";
34

45
import * as core from "@actions/core";
@@ -376,7 +377,9 @@ test("getFileOidsUnderPath throws on unexpected output format", async (t) => {
376377
});
377378

378379
test("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

381384
const version = await gitUtils.getGitVersionOrThrow();
382385
t.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

405408
const 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
407410
t.is(version.truncatedVersion, "2.40.0");
408411
t.is(version.fullVersion, "2.40.0.windows.1");
409412
});

0 commit comments

Comments
 (0)