mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-96100 GitHub: set tracked branch on sharing unversioned project
This commit is contained in:
@@ -92,6 +92,10 @@ public interface Git {
|
||||
@NotNull
|
||||
GitCommandResult tip(@NotNull GitRepository repository, @NotNull String branchName);
|
||||
|
||||
@NotNull
|
||||
GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
boolean updateTracking, @NotNull GitLineHandlerListener... listeners);
|
||||
|
||||
@NotNull
|
||||
GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
@NotNull GitLineHandlerListener... listeners);
|
||||
|
||||
@@ -357,7 +357,7 @@ public class GitImpl implements Git {
|
||||
@Override
|
||||
@NotNull
|
||||
public GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
@NotNull GitLineHandlerListener... listeners) {
|
||||
boolean updateTracking, @NotNull GitLineHandlerListener... listeners) {
|
||||
final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(),
|
||||
GitCommand.PUSH);
|
||||
h.setUrl(url);
|
||||
@@ -366,9 +366,19 @@ public class GitImpl implements Git {
|
||||
h.addProgressParameter();
|
||||
h.addParameters(remote);
|
||||
h.addParameters(spec);
|
||||
if (updateTracking) {
|
||||
h.addParameters("--set-upstream");
|
||||
}
|
||||
return run(h);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
@NotNull GitLineHandlerListener... listeners) {
|
||||
return push(repository, remote, url, spec, false, listeners);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public GitCommandResult push(@NotNull GitRepository repository, @NotNull GitPushSpec pushSpec, @NotNull String url,
|
||||
|
||||
@@ -188,6 +188,13 @@ public class GitTestImpl implements Git {
|
||||
return execute(repository, "rev-list -1 " + branchName);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
boolean updateTracking, @NotNull GitLineHandlerListener... listeners) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GitCommandResult push(@NotNull GitRepository repository, @NotNull String remote, @NotNull String url, @NotNull String spec,
|
||||
|
||||
@@ -375,7 +375,7 @@ public class GithubShareAction extends DumbAwareAction {
|
||||
"no current branch");
|
||||
return false;
|
||||
}
|
||||
GitCommandResult result = git.push(repository, remoteName, remoteUrl, currentBranch.getName());
|
||||
GitCommandResult result = git.push(repository, remoteName, remoteUrl, currentBranch.getName(), true);
|
||||
if (!result.success()) {
|
||||
GithubNotifications.showError(project, "Can't finish GitHub sharing process", "Successfully created project '" +
|
||||
name +
|
||||
|
||||
Reference in New Issue
Block a user