67 references to GitFailure
aspire (20)
Configuration\ConfigSourceService.cs (3)
852GitFailure.Unavailable => ConfigSourceStrings.GitNotFound, 853GitFailure.AuthenticationFailed => ConfigSourceStrings.AuthenticationFailed, 854GitFailure.UnattendedSshUnsupported => exception.Message,
Git\GitCommandException.cs (7)
6internal sealed class GitCommandException(GitFailure failure, int? exitCode) 9GitFailure.Unavailable => Resources.ErrorStrings.GitUnavailable, 10GitFailure.AuthenticationFailed => Resources.ErrorStrings.GitAuthenticationFailed, 11GitFailure.RepositoryUnavailable => Resources.ErrorStrings.GitRepositoryUnavailable, 12GitFailure.TimedOut => Resources.ErrorStrings.GitTimedOut, 13GitFailure.UnattendedSshUnsupported => Resources.ErrorStrings.GitUnattendedSshUnsupported, 17public GitFailure Failure { get; } = failure;
Git\GitCommandRunner.cs (9)
165throw new GitCommandException(GitFailure.UnattendedSshUnsupported, null); 198throw new GitCommandException(GitFailure.UnattendedSshUnsupported, null); 204throw new GitCommandException(GitFailure.UnattendedSshUnsupported, null); 255catch (GitCommandException ex) when (ex.Failure == GitFailure.CommandFailed) 411throw new GitCommandException(GitFailure.Unavailable, null); 415throw new GitCommandException(GitFailure.RepositoryUnavailable, null); 442return new GitCommandException(authentication ? GitFailure.AuthenticationFailed 443: unavailable ? GitFailure.RepositoryUnavailable : GitFailure.CommandFailed, exitCode);
Templating\TemplateEngineFactory.cs (1)
254throw new GitCommandException(GitFailure.TimedOut, null);
Aspire.Cli.Tests (47)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (5)
3040 => new GitCommandException(GitFailure.RepositoryUnavailable, 128), 3051 => new GitCommandException(GitFailure.Unavailable, null), 3062 => new GitCommandException(GitFailure.AuthenticationFailed, 128), 3073 => new GitCommandException(GitFailure.TimedOut, null), 608throw new GitCommandException(GitFailure.AuthenticationFailed, 128);
Commands\NewCommandLocalTemplateTests.cs (4)
14930 => new GitCommandException(GitFailure.RepositoryUnavailable, 128), 14941 => new GitCommandException(GitFailure.Unavailable, null), 14952 => 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)] 45var kind = Enum.Parse<GitFailure>(failure); 55GitFailure.Unavailable => ConfigSourceStrings.GitNotFound, 56GitFailure.AuthenticationFailed => ConfigSourceStrings.AuthenticationFailed, 243Assert.Equal(GitFailure.RepositoryUnavailable, error.Failure);
Git\GitCommandRunnerTests.Authentication.cs (4)
86Assert.Equal(GitFailure.AuthenticationFailed, exception.Failure); 121Assert.Equal(GitFailure.AuthenticationFailed, exception.Failure); 160Assert.Equal(GitFailure.UnattendedSshUnsupported, exception.Failure); 192Assert.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))] 148var failure = Enum.Parse<GitFailure>(expectedFailure); 153GitFailure.AuthenticationFailed => ErrorStrings.GitAuthenticationFailed, 154GitFailure.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))] 171Assert.Equal(Enum.Parse<GitFailure>(expectedFailure), exception.Failure); 187Assert.Equal(GitFailure.Unavailable, exception.Failure); 302Assert.Equal(GitFailure.AuthenticationFailed, exception.Failure); 387Assert.Equal(GitFailure.CommandFailed, exception.Failure);
Templating\TemplateEngineFactoryGitTests.cs (1)
115? throw new GitCommandException(GitFailure.CommandFailed, 128)