Skip to content

Commit

Permalink
deepenGitHistory: specify HEAD
Browse files Browse the repository at this point in the history
This commit makes deepenGitHistory pass "origin HEAD" to Git fetch,
which prevents Git from fetching all branches that are present in the
remote repository.
  • Loading branch information
Chuan-kai Lin committed Dec 9, 2024
1 parent 70aac4e commit dd4aa40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const determineBaseBranchHeadCommitOid = async function (
};

/**
* Deepen the git history of the given ref by one level. Errors are logged.
* Deepen the git history of HEAD by one level. Errors are logged.
*
* This function uses the `checkout_path` to determine the repository path and
* works only when called from `analyze` or `upload-sarif`.
Expand All @@ -172,7 +172,7 @@ export const deepenGitHistory = async function () {
try {
await runGitCommand(
getOptionalInput("checkout_path"),
["fetch", "--no-tags", "--deepen=1"],
["fetch", "origin", "HEAD", "--no-tags", "--deepen=1"],
"Cannot deepen the shallow repository.",
);
} catch {
Expand Down

0 comments on commit dd4aa40

Please sign in to comment.