Skip to content

Commit 025dc8a

Browse files
committed
add remote from push
1 parent 0700c9e commit 025dc8a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

extensions/git/src/commands.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,9 +2005,17 @@ export class CommandCenter {
20052005
const remotes = repository.remotes;
20062006

20072007
if (remotes.length === 0) {
2008-
if (!pushOptions.silent) {
2009-
window.showWarningMessage(localize('no remotes to push', "Your repository has no remotes configured to push to."));
2008+
if (pushOptions.silent) {
2009+
return;
2010+
}
2011+
2012+
const addRemote = localize('addremote', 'Add Remote');
2013+
const result = await window.showWarningMessage(localize('no remotes to push', "Your repository has no remotes configured to push to."), addRemote);
2014+
2015+
if (result === addRemote) {
2016+
await this.addRemote(repository);
20102017
}
2018+
20112019
return;
20122020
}
20132021

0 commit comments

Comments
 (0)