67 references to GitFailure
aspire (20)
Configuration\ConfigSourceService.cs (3)
852
GitFailure
.Unavailable => ConfigSourceStrings.GitNotFound,
853
GitFailure
.AuthenticationFailed => ConfigSourceStrings.AuthenticationFailed,
854
GitFailure
.UnattendedSshUnsupported => exception.Message,
Git\GitCommandException.cs (7)
6
internal sealed class GitCommandException(
GitFailure
failure, int? exitCode)
9
GitFailure
.Unavailable => Resources.ErrorStrings.GitUnavailable,
10
GitFailure
.AuthenticationFailed => Resources.ErrorStrings.GitAuthenticationFailed,
11
GitFailure
.RepositoryUnavailable => Resources.ErrorStrings.GitRepositoryUnavailable,
12
GitFailure
.TimedOut => Resources.ErrorStrings.GitTimedOut,
13
GitFailure
.UnattendedSshUnsupported => Resources.ErrorStrings.GitUnattendedSshUnsupported,
17
public
GitFailure
Failure { get; } = failure;
Git\GitCommandRunner.cs (9)
165
throw new GitCommandException(
GitFailure
.UnattendedSshUnsupported, null);
198
throw new GitCommandException(
GitFailure
.UnattendedSshUnsupported, null);
204
throw new GitCommandException(
GitFailure
.UnattendedSshUnsupported, null);
255
catch (GitCommandException ex) when (ex.Failure ==
GitFailure
.CommandFailed)
411
throw new GitCommandException(
GitFailure
.Unavailable, null);
415
throw new GitCommandException(
GitFailure
.RepositoryUnavailable, null);
442
return new GitCommandException(authentication ?
GitFailure
.AuthenticationFailed
443
: unavailable ?
GitFailure
.RepositoryUnavailable :
GitFailure
.CommandFailed, exitCode);
Templating\TemplateEngineFactory.cs (1)
254
throw new GitCommandException(
GitFailure
.TimedOut, null);
Aspire.Cli.Tests (47)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (5)
304
0 => new GitCommandException(
GitFailure
.RepositoryUnavailable, 128),
305
1 => new GitCommandException(
GitFailure
.Unavailable, null),
306
2 => new GitCommandException(
GitFailure
.AuthenticationFailed, 128),
307
3 => new GitCommandException(
GitFailure
.TimedOut, null),
608
throw new GitCommandException(
GitFailure
.AuthenticationFailed, 128);
Commands\NewCommandLocalTemplateTests.cs (4)
1493
0 => new GitCommandException(
GitFailure
.RepositoryUnavailable, 128),
1494
1 => new GitCommandException(
GitFailure
.Unavailable, null),
1495
2 => new GitCommandException(
GitFailure
.AuthenticationFailed, 128),
1496
_ => new GitCommandException(
GitFailure
.TimedOut, null)
Configuration\ConfigSourceServiceGitTests.cs (13)
34
[InlineData(nameof(
GitFailure
.Unavailable), false)]
35
[InlineData(nameof(
GitFailure
.Unavailable), true)]
36
[InlineData(nameof(
GitFailure
.AuthenticationFailed), false)]
37
[InlineData(nameof(
GitFailure
.AuthenticationFailed), true)]
38
[InlineData(nameof(
GitFailure
.CommandFailed), false)]
39
[InlineData(nameof(
GitFailure
.CommandFailed), true)]
40
[InlineData(nameof(
GitFailure
.RepositoryUnavailable), false)]
41
[InlineData(nameof(
GitFailure
.RepositoryUnavailable), true)]
45
var
kind = Enum.Parse<
GitFailure
>(failure);
55
GitFailure
.Unavailable => ConfigSourceStrings.GitNotFound,
56
GitFailure
.AuthenticationFailed => ConfigSourceStrings.AuthenticationFailed,
243
Assert.Equal(
GitFailure
.RepositoryUnavailable, error.Failure);
Git\GitCommandRunnerTests.Authentication.cs (4)
86
Assert.Equal(
GitFailure
.AuthenticationFailed, exception.Failure);
121
Assert.Equal(
GitFailure
.AuthenticationFailed, exception.Failure);
160
Assert.Equal(
GitFailure
.UnattendedSshUnsupported, exception.Failure);
192
Assert.Equal(
GitFailure
.UnattendedSshUnsupported, exception.Failure);
Git\GitCommandRunnerTests.cs (20)
127
[InlineData("fatal: repository not found", nameof(
GitFailure
.RepositoryUnavailable))]
128
[InlineData("fatal: could not resolve host", nameof(
GitFailure
.RepositoryUnavailable))]
129
[InlineData("fatal: unable to access repository", nameof(
GitFailure
.RepositoryUnavailable))]
130
[InlineData("fatal: could not read from remote repository", nameof(
GitFailure
.RepositoryUnavailable))]
131
[InlineData("fatal: Authentication failed", nameof(
GitFailure
.AuthenticationFailed))]
132
[InlineData("Permission denied (publickey).", nameof(
GitFailure
.AuthenticationFailed))]
133
[InlineData("fatal: could not read Username", nameof(
GitFailure
.AuthenticationFailed))]
134
[InlineData("fatal: could not read Password", nameof(
GitFailure
.AuthenticationFailed))]
135
[InlineData("fatal: unexpected failure", nameof(
GitFailure
.CommandFailed))]
148
var
failure = Enum.Parse<
GitFailure
>(expectedFailure);
153
GitFailure
.AuthenticationFailed => ErrorStrings.GitAuthenticationFailed,
154
GitFailure
.RepositoryUnavailable => ErrorStrings.GitRepositoryUnavailable,
164
[InlineData(nameof(GitCommandMode.Captured), nameof(
GitFailure
.AuthenticationFailed))]
165
[InlineData(nameof(GitCommandMode.Interactive), nameof(
GitFailure
.CommandFailed))]
166
[InlineData(nameof(GitCommandMode.Unattended), nameof(
GitFailure
.CommandFailed))]
171
Assert.Equal(Enum.Parse<
GitFailure
>(expectedFailure), exception.Failure);
187
Assert.Equal(
GitFailure
.Unavailable, exception.Failure);
302
Assert.Equal(
GitFailure
.AuthenticationFailed, exception.Failure);
387
Assert.Equal(
GitFailure
.CommandFailed, exception.Failure);
Templating\TemplateEngineFactoryGitTests.cs (1)
115
? throw new GitCommandException(
GitFailure
.CommandFailed, 128)