Skip to content

Commit 445f1f3

Browse files
authored
Merge pull request #824: Return result code when process is stopping [M147]
2 parents dfec94c + f31e82d commit 445f1f3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

GVFS/GVFS.Common/Git/GitProcess.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ public class Result
752752
{
753753
public const int SuccessCode = 0;
754754
public const int GenericFailureCode = 1;
755+
public const int ExitDueToShutDownCode = 2;
755756

756757
public Result(string stdout, string stderr, int exitCode)
757758
{
@@ -771,7 +772,7 @@ public bool ExitCodeIsSuccess
771772

772773
public bool ExitCodeIsFailure
773774
{
774-
get { return !this.ExitCodeIsSuccess; }
775+
get { return !this.ExitCodeIsSuccess && this.ExitCode != ExitDueToShutDownCode; }
775776
}
776777

777778
public bool StderrContainsErrors()

GVFS/GVFS.Common/Maintenance/GitMaintenanceStep.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,12 @@ protected GitProcess.Result RunGitCommand(Func<GitProcess, GitProcess.Result> wo
120120
{
121121
if (this.Stopping)
122122
{
123+
string message = this.Area + "Not launching Git process because the mount is stopping";
123124
this.Context.Tracer.RelatedWarning(
124125
metadata: null,
125-
message: this.Area + ": Not launching Git process because the mount is stopping",
126+
message: message,
126127
keywords: Keywords.Telemetry);
127-
return null;
128+
return new GitProcess.Result(message, string.Empty, GitProcess.Result.ExitDueToShutDownCode);
128129
}
129130

130131
GitProcess.Result result = work.Invoke(this.GitProcess);

0 commit comments

Comments
 (0)