Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
//! Test for `set_extensions`, which writes a global state maintained by libgit2 |
| 2 |
|
| 3 |
use git2::opts::{get_extensions, set_extensions}; |
| 4 |
use git2::Error; |
| 5 |
|
| 6 |
#[test] |
| 7 |
fn test_remove_extensions() -> Result<(), Error> { |
| 8 |
unsafe { |
| 9 |
set_extensions(&[ |
| 10 |
"custom", |
| 11 |
"!ignore", |
| 12 |
"!noop", |
| 13 |
"!objectformat", |
| 14 |
"!preciousobjects", |
| 15 |
"!worktreeconfig", |
| 16 |
"other", |
| 17 |
])?; |
| 18 |
} |
| 19 |
|
| 20 |
let extensions = unsafe { get_extensions() }?; |
| 21 |
let extensions: Result<Vec<_>, Error> = extensions.iter().collect(); |
| 22 |
let extensions = extensions.unwrap(); |
| 23 |
|
| 24 |
assert_eq!(extensions, [Some("custom"), Some("other")]); |
| 25 |
|
| 26 |
Ok(()) |
| 27 |
} |