Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@
"default": false,
"description": "%githubPullRequests.ignoreSubmodules.description%"
},
"githubPullRequests.allowReposOutsideWorkspace": {
"type": "boolean",
"default": false,
"description": "%githubPullRequests.allowReposOutsideWorkspace.description%"
},
"githubPullRequests.neverIgnoreDefaultBranch": {
"type": "boolean",
"description": "%githubPullRequests.neverIgnoreDefaultBranch.description%"
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"githubPullRequests.ignoredPullRequestBranches.description": "Prevents branches that are associated with a pull request from being automatically detected. This will prevent review mode from being entered on these branches.",
"githubPullRequests.ignoredPullRequestBranches.items": "Branch name",
"githubPullRequests.ignoreSubmodules.description": "Prevents repositories that are submodules from being managed by the GitHub Pull Requests extension. A window reload is required for changes to this setting to take effect.",
"githubPullRequests.allowReposOutsideWorkspace.description": "Allows repositories that are outside of the workspace folders to be managed by the GitHub Pull Requests extension. A window reload is required for changes to this setting to take effect.",
"githubPullRequests.neverIgnoreDefaultBranch.description": "Never offer to ignore a pull request associated with the default branch of a repository.",
"githubPullRequests.overrideDefaultBranch.description": "The default branch for a repository is set on github.com. With this setting, you can override that default with another branch.",
"githubPullRequests.postCreate.description": "The action to take after creating a pull request.",
Expand Down
1 change: 1 addition & 0 deletions src/common/settingKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const ASSIGN_TO = 'assignCreated';
export const PUSH_BRANCH = 'pushBranch';
export const IGNORE_PR_BRANCHES = 'ignoredPullRequestBranches';
export const IGNORE_SUBMODULES = 'ignoreSubmodules';
export const ALLOW_REPOS_OUTSIDE_WORKSPACE = 'allowReposOutsideWorkspace';
export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
export const PULL_BRANCH = 'pullBranch';
Expand Down
5 changes: 3 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isSubmodule } from './common/gitUtils';
import Logger from './common/logger';
import * as PersistentState from './common/persistentState';
import { parseRepositoryRemotes } from './common/remote';
import { BRANCH_PUBLISH, EXPERIMENTAL_CHAT, FILE_LIST_LAYOUT, GIT, IGNORE_SUBMODULES, OPEN_DIFF_ON_CLICK, PR_SETTINGS_NAMESPACE, SHOW_INLINE_OPEN_FILE_ACTION } from './common/settingKeys';
import { ALLOW_REPOS_OUTSIDE_WORKSPACE, BRANCH_PUBLISH, EXPERIMENTAL_CHAT, FILE_LIST_LAYOUT, GIT, IGNORE_SUBMODULES, OPEN_DIFF_ON_CLICK, PR_SETTINGS_NAMESPACE, SHOW_INLINE_OPEN_FILE_ACTION } from './common/settingKeys';
import { initBasedOnSettingChange } from './common/settingsUtils';
import { TemporaryState } from './common/temporaryState';
import { Schemes } from './common/uri';
Expand Down Expand Up @@ -228,7 +228,8 @@ async function init(
}

// Check if repo is in one of the workspace folders or vice versa
if (workspaceFolders && !workspaceFolders.some(folder => isDescendant(folder.uri.fsPath, repo.rootUri.fsPath) || isDescendant(repo.rootUri.fsPath, folder.uri.fsPath))) {
const allowReposOutsideWorkspace = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get<boolean>(ALLOW_REPOS_OUTSIDE_WORKSPACE, false);
if (!allowReposOutsideWorkspace && workspaceFolders && !workspaceFolders.some(folder => isDescendant(folder.uri.fsPath, repo.rootUri.fsPath) || isDescendant(repo.rootUri.fsPath, folder.uri.fsPath))) {
Logger.appendLine(`Repo ${repo.rootUri} is not in a workspace folder, ignoring.`, ACTIVATION);
return;
}
Expand Down