@@ -92,10 +92,10 @@ mod branch {
92
92
self . subsection_names_of ( "branch" )
93
93
}
94
94
95
- /// Returns a reference to the remote associated with the given `short_branch_name`,
95
+ /// Returns the validated reference on the remote associated with the given `short_branch_name`,
96
96
/// always `main` instead of `refs/heads/main`.
97
97
///
98
- /// The remote-ref is the one we track on the remote side for merging and pushing.
98
+ /// The returned reference is the one we track on the remote side for merging and pushing.
99
99
/// Returns `None` if the remote reference was not found.
100
100
/// May return an error if the reference is invalid.
101
101
pub fn branch_remote_ref (
@@ -111,9 +111,13 @@ mod branch {
111
111
} )
112
112
}
113
113
114
- /// Returns the name of the remote associated with the given `short_branch_name`, typically `main` instead of `refs/heads/main`.
114
+ /// Returns the unvalidated name of the remote associated with the given `short_branch_name`,
115
+ /// typically `main` instead of `refs/heads/main`.
115
116
/// In some cases, the returned name will be an URL.
116
117
/// Returns `None` if the remote was not found.
118
+ ///
119
+ /// See also [Reference::remote_name()][crate::Reference::remote_name()] for a more typesafe version
120
+ /// to be used when a `Reference` is available.
117
121
pub fn branch_remote_name ( & self , short_branch_name : & str ) -> Option < Cow < ' _ , BStr > > {
118
122
self . config . resolved . string ( "branch" , Some ( short_branch_name) , "remote" )
119
123
}
0 commit comments