syntax = "proto3";

package gitaly;

import "shared.proto";

service RepositoryService {
  rpc RepositoryExists(RepositoryExistsRequest) returns (RepositoryExistsResponse) {}
  rpc RepackIncremental(RepackIncrementalRequest) returns (RepackIncrementalResponse) {};
  rpc RepackFull(RepackFullRequest) returns (RepackFullResponse) {};
  rpc GarbageCollect(GarbageCollectRequest) returns (GarbageCollectResponse) {};
  rpc RepositorySize(RepositorySizeRequest) returns (RepositorySizeResponse) {}

  // Deprecated, use the RepositoryExists RPC instead.
  rpc Exists(RepositoryExistsRequest) returns (RepositoryExistsResponse) {}
}

message RepositoryExistsRequest {
  Repository repository = 1;
}

message RepositoryExistsResponse {
  bool exists = 1;
}

message RepackIncrementalRequest {
  Repository repository = 1;
}

message RepackIncrementalResponse {}

message RepackFullRequest {
  Repository repository = 1;
  bool create_bitmap = 2;
}

message RepackFullResponse {}

message GarbageCollectRequest {
  Repository repository = 1;
  bool create_bitmap = 2;
}

message GarbageCollectResponse {}

message RepositorySizeRequest {
  Repository repository = 1;
}

message RepositorySizeResponse {
  // Repository size in kilobytes
  int64 size = 1;
}
