Quellcode durchsuchen

Add publish context menu action to local branches in graph (#2619)

main
Ramin Tadayon vor 1 Jahr
committed von GitHub
Ursprung
Commit
ab31b2b397
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 27 neuen und 0 gelöschten Zeilen
  1. +16
    -0
      package.json
  2. +11
    -0
      src/plus/webviews/graph/graphWebview.ts

+ 16
- 0
package.json Datei anzeigen

@ -6975,6 +6975,13 @@
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.publishBranch",
"title": "Publish Branch",
"category": "GitLens",
"icon": "$(cloud-upload)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.rebaseOntoBranch",
"title": "Rebase Current Branch onto Branch...",
"category": "GitLens",
@ -9181,6 +9188,10 @@
"when": "false"
},
{
"command": "gitlens.graph.publishBranch",
"when": "false"
},
{
"command": "gitlens.graph.rebaseOntoBranch",
"when": "false"
},
@ -11936,6 +11947,11 @@
"alt": "gitlens.copyRemoteBranchUrl"
},
{
"command": "gitlens.graph.publishBranch",
"when": "gitlens:hasRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)(?!.*?\\b\\+tracking\\b)/",
"group": "8_gitlens_actions@13"
},
{
"command": "gitlens.graph.cherryPick",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:commit\\b(?!.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@1"

+ 11
- 0
src/plus/webviews/graph/graphWebview.ts Datei anzeigen

@ -308,6 +308,7 @@ export class GraphWebviewProvider implements WebviewProvider {
registerCommand('gitlens.graph.push', this.push, this),
registerCommand('gitlens.graph.pull', this.pull, this),
registerCommand('gitlens.graph.fetch', this.fetch, this),
registerCommand('gitlens.graph.publishBranch', this.publishBranch, this),
registerCommand('gitlens.graph.switchToAnotherBranch', this.switchToAnother, this),
registerCommand('gitlens.graph.createBranch', this.createBranch, this),
@ -2018,6 +2019,16 @@ export class GraphWebviewProvider implements WebviewProvider {
}
@debug()
private publishBranch(item?: GraphItemContext) {
if (isGraphItemRefContext(item, 'branch')) {
const { ref } = item.webviewItemValue;
return RepoActions.push(ref.repoPath, undefined, ref);
}
return Promise.resolve();
}
@debug()
private rebase(item?: GraphItemContext) {
const ref = this.getGraphItemRef(item);
if (ref == null) return Promise.resolve();

Laden…
Abbrechen
Speichern