Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit bf407f7

Browse files
committed
feat: detect external pull request and allow to pull it
This case enables external pull requests (from forked repo without write permission) to be checked out for review. For security reasons the user needs to confirm to pull external code (it could be harmful to pull code if watch tasks are running over external code). Closes #258
1 parent f166cfd commit bf407f7

11 files changed

Lines changed: 564 additions & 224 deletions

File tree

src/commands/pull-requests.ts

Lines changed: 142 additions & 86 deletions
Large diffs are not rendered by default.

src/git.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,22 @@ export class Git {
281281
}
282282
}
283283

284+
public async branch(
285+
name: string,
286+
base: string,
287+
uri: vscode.Uri
288+
): Promise<void> {
289+
await this.execute(`git checkout -b ${name} ${base}`, uri);
290+
}
291+
292+
public async pullExternal(
293+
repositoryUrl: string,
294+
branch: string,
295+
uri: vscode.Uri
296+
): Promise<void> {
297+
await this.execute(`git pull ${repositoryUrl} ${branch}`, uri);
298+
}
299+
284300
private logAndShowError(e: Error): void {
285301
if (this.channel) {
286302
this.channel.appendLine(e.message);

0 commit comments

Comments
 (0)