Skip to content

Commit dd4aa40

Browse files
committed
deepenGitHistory: specify HEAD
This commit makes deepenGitHistory pass "origin HEAD" to Git fetch, which prevents Git from fetching all branches that are present in the remote repository.
1 parent 70aac4e commit dd4aa40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/actions-util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const determineBaseBranchHeadCommitOid = async function (
163163
};
164164

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

0 commit comments

Comments
 (0)