From c788b51e73f41c95058c56add378e9b65f342322 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 1 Nov 2022 19:51:53 +0100 Subject: [PATCH] update docs (#450) --- git-repository/src/reference/remote.rs | 2 +- git-repository/src/repository/config.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/git-repository/src/reference/remote.rs b/git-repository/src/reference/remote.rs index 79600bd5238..16de595e3a2 100644 --- a/git-repository/src/reference/remote.rs +++ b/git-repository/src/reference/remote.rs @@ -34,7 +34,7 @@ impl Name<'_> { /// Remotes impl<'repo> Reference<'repo> { - /// Find the name of our remote for `direction` as configured in `branch..remote|pushRemote` respectively. + /// Find the unvalidated name of our remote for `direction` as configured in `branch..remote|pushRemote` respectively. /// If `Some()` it can be used in [`Repository::find_remote(…)`][crate::Repository::find_remote()], or if `None` then /// [Repository::remote_default_name()][crate::Repository::remote_default_name()] could be used in its place. /// diff --git a/git-repository/src/repository/config.rs b/git-repository/src/repository/config.rs index 3a2de9298ea..497ef717b8d 100644 --- a/git-repository/src/repository/config.rs +++ b/git-repository/src/repository/config.rs @@ -92,10 +92,10 @@ mod branch { self.subsection_names_of("branch") } - /// Returns a reference to the remote associated with the given `short_branch_name`, + /// Returns the validated reference on the remote associated with the given `short_branch_name`, /// always `main` instead of `refs/heads/main`. /// - /// The remote-ref is the one we track on the remote side for merging and pushing. + /// The returned reference is the one we track on the remote side for merging and pushing. /// Returns `None` if the remote reference was not found. /// May return an error if the reference is invalid. pub fn branch_remote_ref( @@ -111,9 +111,13 @@ mod branch { }) } - /// Returns the name of the remote associated with the given `short_branch_name`, typically `main` instead of `refs/heads/main`. + /// Returns the unvalidated name of the remote associated with the given `short_branch_name`, + /// typically `main` instead of `refs/heads/main`. /// In some cases, the returned name will be an URL. /// Returns `None` if the remote was not found. + /// + /// See also [Reference::remote_name()][crate::Reference::remote_name()] for a more typesafe version + /// to be used when a `Reference` is available. pub fn branch_remote_name(&self, short_branch_name: &str) -> Option> { self.config.resolved.string("branch", Some(short_branch_name), "remote") }