Skip to content

Commit

Permalink
Merge pull request #49 from tony84727/perf/unshallow_with_filter
Browse files Browse the repository at this point in the history
perf: unshallow with a filter
  • Loading branch information
tony84727 authored Aug 31, 2024
2 parents 8eb91f2 + 6b6d74a commit a374177
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export async function revParse(rev: string, cwd?: string): Promise<string> {
return output.trim()
}

export async function unshallow(): Promise<number> {
return exec('git', ['fetch', '--prune', '--unshallow'])
export async function unshallowHistories(): Promise<number> {
return exec('git', ['fetch', '--prune', '--unshallow', '--filter=blob:none'])
}
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import {Rule, parseRules} from './rule'
import {getChangedFiles, revParse, unshallow} from './git'
import {getChangedFiles, revParse, unshallowHistories} from './git'
import {newGlobber} from './glob'
function evaluateRule(rule: Rule, changedFiles: string[]): string[] {
const globber = newGlobber(rule.match)
Expand All @@ -25,7 +25,7 @@ async function getHeadSha(): Promise<string> {
async function run(): Promise<void> {
try {
const event = core.getInput('event')
await unshallow()
await unshallowHistories()
const baseSha = await getBaseSha(event)
const headSha = await getHeadSha()
core.debug(`baseSha: ${baseSha}`)
Expand Down

0 comments on commit a374177

Please sign in to comment.