pub struct NewRepo {
pub path: RepoRef,
pub hash_kind: HashKind,
pub default_branch: Option<String>,
pub visibility: Visibility,
pub description: String,
}Expand description
What a new repository is created with.
Server defaults are applied here rather than by the caller, so the gRPC service, the CLI and a test all get the same repository (one implementation).
Fields§
§path: RepoRefWhere it lives.
hash_kind: HashKindsha1 or sha256. Defaults to sha256.
default_branch: Option<String>Full ref name. None means DEFAULT_BRANCH.
visibility: VisibilityDefaults to Visibility::Private.
description: StringFree text, for UIs.
Implementations§
Source§impl NewRepo
impl NewRepo
Sourcepub fn new(path: RepoRef) -> Self
pub fn new(path: RepoRef) -> Self
A private sha256 repository at path, with the default branch.
Sourcepub fn hash_kind(self, kind: HashKind) -> Self
pub fn hash_kind(self, kind: HashKind) -> Self
Set the hash kind. sha1 repositories are fully supported.
Sourcepub fn visibility(self, visibility: Visibility) -> Self
pub fn visibility(self, visibility: Visibility) -> Self
Set the visibility.
Sourcepub fn default_branch(self, name: impl Into<String>) -> Self
pub fn default_branch(self, name: impl Into<String>) -> Self
Set the default branch, as a full refs/heads/... name.
Sourcepub fn prospect(&self) -> Result<Repo>
pub fn prospect(&self) -> Result<Repo>
The Repo this spec would create, without creating it.
The one place a NewRepo becomes a Repo: RepoCatalog::create
writes exactly this value, and the first-repository door carries it
through a push’s advertisement before the catalog has been touched, so
a client that takes one look at the advertised hash and hangs up (a sha1
working tree against the sha256 default) leaves nothing behind. A
door that wrote the catalog first was the 2026-08-30 ghost-repository
bug: repo get succeeded for a repository whose push was refused.