mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
enhance: show git errors when failed to get the repository root dir of given path (#397)
This commit is contained in:
parent
963916219f
commit
b16d267c9b
14 changed files with 40 additions and 39 deletions
|
@ -17,8 +17,9 @@ namespace SourceGit.Commands
|
|||
|
||||
public class ReadToEndResult
|
||||
{
|
||||
public bool IsSuccess { get; set; }
|
||||
public string StdOut { get; set; }
|
||||
public bool IsSuccess { get; set; } = false;
|
||||
public string StdOut { get; set; } = "";
|
||||
public string StdErr { get; set; } = "";
|
||||
}
|
||||
|
||||
public enum EditorType
|
||||
|
@ -198,18 +199,20 @@ namespace SourceGit.Commands
|
|||
{
|
||||
proc.Start();
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
return new ReadToEndResult()
|
||||
{
|
||||
IsSuccess = false,
|
||||
StdOut = string.Empty,
|
||||
StdErr = e.Message,
|
||||
};
|
||||
}
|
||||
|
||||
var rs = new ReadToEndResult()
|
||||
{
|
||||
StdOut = proc.StandardOutput.ReadToEnd(),
|
||||
StdErr = proc.StandardError.ReadToEnd(),
|
||||
};
|
||||
|
||||
proc.WaitForExit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue