syntax = "proto3";

package gitaly;

option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";

// AccessCheckError is an error returned by GitLab's `/internal/allowed`
// endpoint.
message AccessCheckError {
  // ErrorMessage is the error message as returned by the endpoint.
  string error_message = 1;
  // Protocol is the protocol used.
  string protocol = 2;
  // UserId is the user ID as which changes had been pushed.
  string user_id = 3;
  // Changes is the set of changes which have failed the access check.
  bytes changes = 4;
}

// MergeConflictError is an error returned in the case when merging two commits
// fails due to a merge conflict.
message MergeConflictError {
  // ConflictingFiles is the set of files which have been conflicting. If this
  // field is empty, then there has still been a merge conflict, but it wasn't
  // able to determine which files have been conflicting.
  repeated bytes conflicting_files = 1;
}

// ReferenceUpdateError is an error returned when updating a reference has
// failed.
message ReferenceUpdateError {
  // ReferenceName is the name of the reference that failed to be updated.
  bytes reference_name = 1;
  // OldOid is the object ID the reference should have pointed to before the update.
  string old_oid = 2;
  // NewOid is the object ID the reference should have pointed to after the update.
  string new_oid = 3;
}

// ResolveRevisionError is an error returned when resolving a specific revision
// has failed.
message ResolveRevisionError {
  // Revision is the name of the revision that was tried to be resolved.
  bytes revision = 1;
}
