From 09bb3a723d0d09c2943c48ed571f38830d4002b3 Mon Sep 17 00:00:00 2001 From: xtex Date: Thu, 6 Feb 2025 17:45:44 +0800 Subject: [PATCH] docs: Document that pushurl_bytes returns null if no push url is set --- src/remote.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/remote.rs b/src/remote.rs index 9e15b351dc..0c13a53fcf 100644 --- a/src/remote.rs +++ b/src/remote.rs @@ -152,12 +152,14 @@ impl<'repo> Remote<'repo> { /// Get the remote's pushurl. /// - /// Returns `None` if the pushurl is not valid utf-8 + /// Returns `None` if the pushurl is not valid utf-8 or no special url for pushing is set. pub fn pushurl(&self) -> Option<&str> { self.pushurl_bytes().and_then(|s| str::from_utf8(s).ok()) } /// Get the remote's pushurl as a byte array. + /// + /// Returns `None` if no special url for pushing is set. pub fn pushurl_bytes(&self) -> Option<&[u8]> { unsafe { crate::opt_bytes(self, raw::git_remote_pushurl(&*self.raw)) } }