Skip to content

Commit

Permalink
Refactor git diff command to use object-based parameters and exclude …
Browse files Browse the repository at this point in the history
…specific paths
  • Loading branch information
pelikhan committed Sep 30, 2024
1 parent 6897762 commit c074fad
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/vscode/genaisrc/prd.genai.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ const defaultBranch = (

// context
// compute diff with the default branch
const { stdout: changes } = await host.exec("git", [
"diff",
defaultBranch,
"--cached",
"--",
".",
":!.vscode/*",
":!*yarn.lock",
":!*THIRD_PARTY_LICENSES.md",
])
const changes = await git.diff({
base: defaultBranch,
staged: true,
excludedPaths: [
":!.vscode/*",
":!*yarn.lock",
":!*THIRD_PARTY_LICENSES.md",
],
})

def("GIT_DIFF", changes, {
language: "diff",
Expand Down

0 comments on commit c074fad

Please sign in to comment.