Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Stack/Commands/Helpers/Questions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public static class Questions
public const string PullRequestStackDescription = "Stack description for pull request:";
public const string OpenPullRequests = "Open new pull requests in a browser?";
public const string CreatePullRequestAsDraft = "Create pull request as draft?";
public const string EditPullRequestBody = "Edit pull request body? This will open a file in your default editor.";
public const string ContinueOrAbortMerge = "Conflict(s) detected during merge. Please either resolve the conflicts, commit the result and select Continue to continue merging, or Abort.";
public const string ContinueOrAbortRebase = "Conflict(s) detected during rebase. Please either resolve the conflicts and select Continue to continue rebasing, or Abort.";
public const string ConfirmMigrateConfig = "Are you sure you want to migrate the configuration file to the latest version? This will create a backup of the current configuration file.";
Expand Down
7 changes: 0 additions & 7 deletions src/Stack/Commands/PullRequests/CreatePullRequestsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public override async Task Handle(CreatePullRequestsCommandInputs inputs)
inputProvider,
logger,
gitClient,
gitHubClient,
fileOperations,
selectedPullRequestActions);

Expand Down Expand Up @@ -235,7 +234,6 @@ private static List<PullRequestInformation> GetPullRequestInformation(
IInputProvider inputProvider,
ILogger logger,
IGitClient gitClient,
IGitHubClient gitHubClient,
IFileOperations fileOperations,
List<PullRequestCreateAction> pullRequestCreateActions)
{
Expand Down Expand Up @@ -272,11 +270,6 @@ private static List<PullRequestInformation> GetPullRequestInformation(

{StackConstants.StackMarkerEnd}");

if (inputProvider.Confirm(Questions.EditPullRequestBody))
{
gitClient.OpenFileInEditorAndWaitForClose(bodyFilePath);
}

var draft = inputProvider.Confirm(Questions.CreatePullRequestAsDraft, false);

pullRequestActions.Add(new PullRequestInformation(
Expand Down
33 changes: 0 additions & 33 deletions src/Stack/Git/GitClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public interface IGitClient
string GetRemoteUri();
string[] GetLocalBranchesOrderedByMostRecentCommitterDate();
string GetRootOfRepository();
void OpenFileInEditorAndWaitForClose(string path);
string? GetConfigValue(string key);
bool IsAncestor(string ancestor, string descendant);
}
Expand Down Expand Up @@ -295,38 +294,6 @@ public bool IsAncestor(string ancestor, string descendant)
return isAncestor;
}

public void OpenFileInEditorAndWaitForClose(string path)
{
var editor = GetConfiguredEditor();
if (string.IsNullOrWhiteSpace(editor))
{
logger.Error("No editor is configured in git. Please configure an editor using 'git config --global core.editor <editor>'.");
return;
}

var editorSplit = editor.Split(' ');
var editorFileName = editorSplit[0];
var editorArguments = editorSplit.Length > 1 ? string.Join(' ', editorSplit.Skip(1)) : string.Empty;

var processStartInfo = new ProcessStartInfo
{
FileName = editorFileName,
Arguments = $"\"{path}\" {editorArguments}",
UseShellExecute = true,
CreateNoWindow = true
};

var process = Process.Start(processStartInfo);

if (process == null)
{
logger.Error("Failed to start editor process.");
return;
}

process.WaitForExit();
}

private string ExecuteGitCommandAndReturnOutput(
string command,
bool captureStandardError = false,
Expand Down