diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6aeb4d363b5..0406a54ea3472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Adds a new `${authorFirst}` and `${authorLast}` commit formatting tokens that can be used in inline blame, commit hovers, etc — closes [#2980](https://github.com/gitkraken/vscode-gitlens/issues/2980) - Adds a way to force push from the Graph - Adds a new `gitlens.launchpad.includedOrganizations` setting to specify which organizations to include in _Launchpad_ — closes [#3550](https://github.com/gitkraken/vscode-gitlens/issues/3550) +- Adds create branch button to the commit graph — closes [#3553](https://github.com/gitkraken/vscode-gitlens/issues/3553) ### Changed diff --git a/src/commands/git/branch.ts b/src/commands/git/branch.ts index 8712422e81e89..b6d5022acbb9c 100644 --- a/src/commands/git/branch.ts +++ b/src/commands/git/branch.ts @@ -1,7 +1,7 @@ import { QuickInputButtons } from 'vscode'; import type { Container } from '../../container'; import type { GitBranchReference, GitReference } from '../../git/models/reference'; -import { getNameWithoutRemote, getReferenceLabel, isRevisionReference } from '../../git/models/reference'; +import { getReferenceLabel, isRevisionReference } from '../../git/models/reference'; import { Repository } from '../../git/models/repository'; import type { GitWorktree } from '../../git/models/worktree'; import { getWorktreesByBranch } from '../../git/models/worktree'; @@ -155,6 +155,10 @@ export class BranchGitCommand extends QuickCommand { switch (args?.state.subcommand) { case 'create': + if (args.state.flags != null) { + counter++; + } + if (args.state.reference != null) { counter++; } @@ -357,7 +361,7 @@ export class BranchGitCommand extends QuickCommand { icon: false, label: state.reference.refType !== 'branch', })}`, - value: state.name ?? getNameWithoutRemote(state.reference), + value: state.name, }); if (result === StepResultBreak) continue; diff --git a/src/commands/gitWizard.ts b/src/commands/gitWizard.ts index a81595b753f8c..3331df19ffcf4 100644 --- a/src/commands/gitWizard.ts +++ b/src/commands/gitWizard.ts @@ -93,7 +93,7 @@ export class GitWizardCommand extends QuickWizardCommandBase { ) { switch (context.command) { case Commands.GitCommandsBranch: - return this.execute({ command: 'branch' }); + return this.execute({ command: 'branch', ...args }); case Commands.GitCommandsBranchCreate: return this.execute({ command: 'branch', state: { subcommand: 'create' } }); case Commands.GitCommandsBranchDelete: diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 85be4a5f02e48..147f965620807 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -2428,7 +2428,16 @@ export class GraphWebviewProvider implements WebviewProvider(undefined); const hover = useRef(undefined); @@ -388,7 +390,7 @@ export function GraphWrapper({ if (!themingChanged) { setStyleProps(state.theming); } - setBranchName(state.branchName); + setBranch(state.branch); setLastFetched(state.lastFetched); setColumns(state.columns); setRows(state.rows ?? []); @@ -1107,7 +1109,7 @@ export function GraphWrapper({ ) : ( '' )} - {branchName} + {branchName}