Skip to content

Revert "Add a customized GitRepositoryError and funnel all Git operations through a method that throws one of those if an operation fails." #2974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public class RepositoryPackageContainer: BasePackageContainer, CustomStringConve
}.1
} catch {
// Examine the error to see if we can come up with a more informative and actionable error message. We know that the revision is expected to be a branch name or a hash (tags are handled through a different code path).
if let error = error as? GitRepositoryError, error.description.contains("Needed a single revision") {
if let gitInvocationError = error as? ProcessResult.Error, gitInvocationError.description.contains("Needed a single revision") {
// It was a Git process invocation error. Take a look at the repository to see if we can come up with a reasonable diagnostic.
if let rev = try? repository.resolveRevision(identifier: revision), repository.exists(revision: rev) {
// Revision does exist, so something else must be wrong.
Expand Down
Loading