Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Remote::list()
1 parent f7648de commit 241e629Copy full SHA for 241e629
1 file changed
src/remote.rs
@@ -384,6 +384,18 @@ impl<'repo> Remote<'repo> {
384
mem::size_of::<RemoteHead<'_>>(),
385
mem::size_of::<*const raw::git_remote_head>()
386
);
387
+ if base.is_null() {
388
+ // We cannot use slice::from_raw_parts() since that requires
389
+ // that the pointer be non-null, but that is fine since the size
390
+ // should be zero
391
+ if size != 0 {
392
+ return Err(Error::from_str(&format!(
393
+ "git_remote_ls() set a null pointer for a list of size {}",
394
+ size
395
+ )));
396
+ }
397
+ return Ok(&[]);
398
399
let slice = slice::from_raw_parts(base as *const _, size as usize);
400
Ok(mem::transmute::<
401
&[*const raw::git_remote_head],
0 commit comments