MCPcopy Index your code
hub / github.com/peter-evans/create-pull-request / fetch

Method fetch

src/git-command-manager.ts:128–162  ·  view source on GitHub ↗
(
    refSpec: string[],
    remoteName?: string,
    options?: string[],
    unshallow = false
  )

Source from the content-addressed store, hash-verified

126 }
127
128 async fetch(
129 refSpec: string[],
130 remoteName?: string,
131 options?: string[],
132 unshallow = false
133 ): Promise<void> {
134 const args = ['-c', 'protocol.version=2', 'fetch']
135 if (!refSpec.some(x => x === tagsRefSpec)) {
136 args.push('--no-tags')
137 }
138
139 args.push('--progress', '--no-recurse-submodules')
140
141 if (
142 unshallow &&
143 utils.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))
144 ) {
145 args.push('--unshallow')
146 }
147
148 if (options) {
149 args.push(...options)
150 }
151
152 if (remoteName) {
153 args.push(remoteName)
154 } else {
155 args.push('origin')
156 }
157 for (const arg of refSpec) {
158 args.push(arg)
159 }
160
161 await this.exec(args)
162 }
163
164 async getCommit(ref: string): Promise<Commit> {
165 const endOfBody = '###EOB###'

Callers 5

tryFetchFunction · 0.80
createOrUpdateBranchFunction · 0.80
beforeTestFunction · 0.80
afterTestFunction · 0.80

Calls 2

execMethod · 0.95
pushMethod · 0.80

Tested by 2

beforeTestFunction · 0.64
afterTestFunction · 0.64