From 99314975b8c0a55641ed722d00dd6f6f36e21aa5 Mon Sep 17 00:00:00 2001 From: Ramin Tadayon <67011668+axosoft-ramint@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:42:09 -0700 Subject: [PATCH] Sends upstream id on a local branch ref to graph (#2560) * Sends upstream id on a local branch ref to graph * Avoids creating (allocating) & spreading an object * Updates graph dependency --------- Co-authored-by: Eric Amodio --- package.json | 2 +- src/env/node/git/localGitProvider.ts | 7 ++++++- src/plus/github/githubGitProvider.ts | 7 ++++++- yarn.lock | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9e85c23..9ef1d2d 100644 --- a/package.json +++ b/package.json @@ -13407,7 +13407,7 @@ "vscode:prepublish": "yarn run bundle" }, "dependencies": { - "@gitkraken/gitkraken-components": "7.3.0", + "@gitkraken/gitkraken-components": "8.0.0", "@microsoft/fast-element": "1.11.0", "@microsoft/fast-react-wrapper": "0.3.16-0", "@octokit/core": "4.2.0", diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 3d93f9d..a1d7eb3 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -2006,7 +2006,12 @@ export class LocalGitProvider implements GitProvider, Disposable { name: tip, isCurrentHead: head, context: serializeWebviewItemContext(context), - upstream: branch?.upstream?.name, + upstream: branch?.upstream != null + ? { + name: branch.upstream.name, + id: getBranchId(repoPath, true, branch.upstream.name), + } + : undefined, }; refHeads.push(refHead); if (branch?.upstream?.name != null) { diff --git a/src/plus/github/githubGitProvider.ts b/src/plus/github/githubGitProvider.ts index 70db5da..344538a 100644 --- a/src/plus/github/githubGitProvider.ts +++ b/src/plus/github/githubGitProvider.ts @@ -1286,7 +1286,12 @@ export class GitHubGitProvider implements GitProvider, Disposable { name: headBranch.name, isCurrentHead: true, context: serializeWebviewItemContext(context), - upstream: headBranch.upstream?.name, + upstream: headBranch.upstream != null + ? { + name: headBranch.upstream.name, + id: getBranchId(repoPath, true, headBranch.upstream.name), + } + : undefined, }, ]; diff --git a/yarn.lock b/yarn.lock index d0aac82..25a317d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -312,10 +312,10 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@gitkraken/gitkraken-components@7.3.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-7.3.0.tgz#fd8f2e8d00e3dc4947997bdf78d0d99632c3b0ff" - integrity sha512-LlftWx9c58jA9vMmhhbkBwTtRQ4RA36/BWH6nZ2aggD+L26umChuIBa4aZ25RU6tTlP+QkwGe8Ybu22NULNTCQ== +"@gitkraken/gitkraken-components@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-8.0.0.tgz#2ab6830de870eb81a44c805dd295f32cd7bada1d" + integrity sha512-cieCMvs8CJg7W/e3Wb4xDRKJjM3JIfnd2BsmSUdI1/g5t9Q2PnVeGgs63gfM7P6JALDq7FgypAamv77VaOijqA== dependencies: "@axosoft/react-virtualized" "9.22.3-gitkraken.3" classnames "2.3.2"