{"record":{"id":"222c576dc334d3d3","repo":"microsoft/vscode","slug":"failed-to-get-main-branch-sha","errorCode":null,"errorMessage":"Failed to get main branch SHA","messagePattern":"Failed to get main branch SHA","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/inlineEdits/vscode-node/components/nesFeedbackSubmitter.ts","lineNumber":507,"sourceCode":"\t * Upload feedback files to the private GitHub repository via a pull request.\n\t * Creates a new branch, uploads files to a timestamped folder, and opens a PR.\n\t * @returns The URL to the pull request, or undefined on failure.\n\t */\n\tprivate async _uploadToPrivateRepo(files: FeedbackFile[], token: string): Promise<string | undefined> {\n\t\tconst timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5);\n\t\tconst folderPath = `feedback/${timestamp}`;\n\n\t\t// Get the current user for commit attribution\n\t\tconst user = await this._getCurrentUser(token);\n\t\tconst username = user?.login ?? 'anonymous';\n\n\t\t// Create a unique branch name for this feedback submission\n\t\tconst branchName = `feedback/${username}/${timestamp}`;\n\n\t\t// Get the SHA of the main branch to create our branch from\n\t\tconst mainBranchSha = await this._getBranchSha(token, 'main');\n\t\tif (!mainBranchSha) {\n\t\t\tthrow new Error('Failed to get main branch SHA');\n\t\t}\n\n\t\t// Create the new branch\n\t\tawait this._createBranch(token, branchName, mainBranchSha);\n\n\t\t// Upload each file to the new branch\n\t\tfor (const file of files) {\n\t\t\tconst filePath = `${folderPath}/${file.name}`;\n\t\t\tawait this._createFileInRepo(filePath, file.content, token, username, timestamp, branchName);\n\t\t}\n\n\t\t// Create the pull request\n\t\tconst prUrl = await this._createPullRequest(token, branchName, username, timestamp, files.length);\n\n\t\treturn prUrl;\n\t}\n\n\t/**","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/inlineEdits/vscode-node/components/nesFeedbackSubmitter.ts#L489-L525","documentation":"Error \"Failed to get main branch SHA\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/inlineEdits/vscode-node/components/nesFeedbackSubmitter.ts:507 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}