mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix<Command>: fix crash reported by https://gitee.com/sourcegit/sourcegit/issues/I43UH1
This commit is contained in:
parent
78bb68b82e
commit
8894705321
2 changed files with 17 additions and 4 deletions
|
@ -110,7 +110,13 @@ namespace SourceGit.Commands {
|
||||||
errs.Add(e.Data);
|
errs.Add(e.Data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
proc.Start();
|
proc.Start();
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (!DontRaiseError) Models.Exception.Raise(e.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
proc.BeginOutputReadLine();
|
proc.BeginOutputReadLine();
|
||||||
proc.BeginErrorReadLine();
|
proc.BeginErrorReadLine();
|
||||||
proc.WaitForExit();
|
proc.WaitForExit();
|
||||||
|
@ -143,7 +149,15 @@ namespace SourceGit.Commands {
|
||||||
if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd;
|
if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd;
|
||||||
|
|
||||||
var proc = new Process() { StartInfo = start };
|
var proc = new Process() { StartInfo = start };
|
||||||
|
try {
|
||||||
proc.Start();
|
proc.Start();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ReadToEndResult() {
|
||||||
|
Output = "",
|
||||||
|
Error = e.Message,
|
||||||
|
IsSuccess = false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var rs = new ReadToEndResult();
|
var rs = new ReadToEndResult();
|
||||||
rs.Output = proc.StandardOutput.ReadToEnd();
|
rs.Output = proc.StandardOutput.ReadToEnd();
|
||||||
|
|
|
@ -4,8 +4,7 @@ namespace SourceGit.Commands {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Config : Command {
|
public class Config : Command {
|
||||||
|
|
||||||
public Config() {
|
public Config() {}
|
||||||
}
|
|
||||||
|
|
||||||
public Config(string repo) {
|
public Config(string repo) {
|
||||||
Cwd = repo;
|
Cwd = repo;
|
||||||
|
|
Loading…
Reference in a new issue