Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@aws-sdk/client-cloudwatch-logs": "^3.1107.0",
"@aws-sdk/client-lambda": "^3.1107.0",
"@datadog/datadog-ci-base": "^5.22.0",
"simple-git": "^3.36.0"
"simple-git": "^4.0.2"
},
"peerDependencies": {
"serverless": "4.x || 3.x || 2.x || 1.x"
Expand Down
8 changes: 4 additions & 4 deletions src/git.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as simpleGit from "simple-git";
import { simpleGit, SimpleGit } from "simple-git";

// Returns a configured SimpleGit.
export const newSimpleGit = async (): Promise<simpleGit.SimpleGit | undefined> => {
export const newSimpleGit = async (): Promise<SimpleGit | undefined> => {
const options = {
baseDir: process.cwd(),
binary: "git",
Expand All @@ -10,12 +10,12 @@ export const newSimpleGit = async (): Promise<simpleGit.SimpleGit | undefined> =
try {
// Attempt to set the baseDir to the root of the repository so the 'git ls-files' command
// returns the tracked files paths relative to the root of the repository.
const git = simpleGit.gitP(options);
const git = simpleGit(options);
const root = await git.revparse("--show-toplevel");
options.baseDir = root;
} catch {
return undefined;
}

return simpleGit.gitP(options);
return simpleGit(options);
};
31 changes: 30 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1619,13 +1619,29 @@ __metadata:
languageName: node
linkType: hard

"@simple-git/args-pathspec@npm:1.0.4, @simple-git/args-pathspec@npm:^1.0.4":
version: 1.0.4
resolution: "@simple-git/args-pathspec@npm:1.0.4"
checksum: 10c0/f62c09daf6a17734b2a13a186421bf0fdbdbd48782d1ca6d751027b2a9f515f11505da672489609f95335a0541d2fcf6d6fd6c2754919245109e92335e437b1b
languageName: node
linkType: hard

"@simple-git/args-pathspec@npm:^1.0.3":
version: 1.0.3
resolution: "@simple-git/args-pathspec@npm:1.0.3"
checksum: 10c0/91bfc99daa956df28e4efd683cd799f60c6d169fce6adf71a9efa80a6b5938fed4b03e55fa929cfd51aed64f3ada5c1e4edad45a3872dbd94d11924b3258b5bc
languageName: node
linkType: hard

"@simple-git/argv-parser@npm:2.0.1":
version: 2.0.1
resolution: "@simple-git/argv-parser@npm:2.0.1"
dependencies:
"@simple-git/args-pathspec": "npm:^1.0.4"
checksum: 10c0/7d2cd9852139ca3b524dcd91f6a887fa505cfb68c8813d7b849005566147365bb1e34f5450411c494fbd714a80c123058e65dc2ffc0b41d059e30bdc98e12223
languageName: node
linkType: hard

"@simple-git/argv-parser@npm:^1.1.0":
version: 1.1.1
resolution: "@simple-git/argv-parser@npm:1.1.1"
Expand Down Expand Up @@ -6511,7 +6527,7 @@ __metadata:
oxlint: "npm:^1.78.0"
oxlint-tsgolint: "npm:^7.0.2001"
serverless-step-functions: "npm:^3.31.2"
simple-git: "npm:^3.36.0"
simple-git: "npm:^4.0.2"
typescript: "npm:^7.0.2"
vitest: "npm:^4.1.11"
peerDependencies:
Expand Down Expand Up @@ -6694,6 +6710,19 @@ __metadata:
languageName: node
linkType: hard

"simple-git@npm:^4.0.2":
version: 4.0.2
resolution: "simple-git@npm:4.0.2"
dependencies:
"@kwsites/file-exists": "npm:^1.1.1"
"@kwsites/promise-deferred": "npm:^1.1.1"
"@simple-git/args-pathspec": "npm:1.0.4"
"@simple-git/argv-parser": "npm:2.0.1"
debug: "npm:^4.4.0"
checksum: 10c0/d028927258fa286d9d8e462f29ec6a37a32398acd7e53cef7fc81e70636c149d7359a542d1a4f8490b342d40d98e341c35c718734aec448fc24fdee88566e981
languageName: node
linkType: hard

"slash@npm:^3.0.0":
version: 3.0.0
resolution: "slash@npm:3.0.0"
Expand Down