MCPcopy
hub / github.com/peter-evans/create-pull-request / tryFetch

Function tryFetch

src/create-or-update-branch.ts:34–49  ·  view source on GitHub ↗
(
  git: GitCommandManager,
  remote: string,
  branch: string,
  depth: number
)

Source from the content-addressed store, hash-verified

32}
33
34export async function tryFetch(
35 git: GitCommandManager,
36 remote: string,
37 branch: string,
38 depth: number
39): Promise<boolean> {
40 try {
41 await git.fetch([`${branch}:refs/remotes/${remote}/${branch}`], remote, [
42 '--force',
43 `--depth=${depth}`
44 ])
45 return true
46 } catch {
47 return false
48 }
49}
50
51export async function buildBranchCommits(
52 git: GitCommandManager,

Callers 2

createOrUpdateBranchFunction · 0.85

Calls 1

fetchMethod · 0.80

Tested by

no test coverage detected