Skip to content

Commit 7b7be43

Browse files
authored
Merge pull request #1124 from xtexx/clarify-doc
docs: Document that pushurl_bytes returns null if no push url is set
2 parents bc646ee + 09bb3a7 commit 7b7be43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/remote.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ impl<'repo> Remote<'repo> {
152152

153153
/// Get the remote's pushurl.
154154
///
155-
/// Returns `None` if the pushurl is not valid utf-8
155+
/// Returns `None` if the pushurl is not valid utf-8 or no special url for pushing is set.
156156
pub fn pushurl(&self) -> Option<&str> {
157157
self.pushurl_bytes().and_then(|s| str::from_utf8(s).ok())
158158
}
159159

160160
/// Get the remote's pushurl as a byte array.
161+
///
162+
/// Returns `None` if no special url for pushing is set.
161163
pub fn pushurl_bytes(&self) -> Option<&[u8]> {
162164
unsafe { crate::opt_bytes(self, raw::git_remote_pushurl(&*self.raw)) }
163165
}

0 commit comments

Comments
 (0)