You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apply diff from index to workdir with delta callback returning false
Estimated behaviour: index remain unchanged. no changes staged. Current behaviour: old file deleted from index.
use git2::{
Repository, ApplyOptions, ApplyLocation
};
fn main() {
// just rename 1 file in repositiry and run this.
// old file will be removed from index.
let repo = Repository::open("./")
.expect("can't open repo");
let git_diff = repo.diff_index_to_workdir(None, None)
.expect("can't get diff");
let mut options = ApplyOptions::new();
options.hunk_callback(|odh| -> bool {
false
});
options.delta_callback(|odd| -> bool {
false
});
repo.apply(
&git_diff,
ApplyLocation::Index,
Some(&mut options),
).expect("can't apply patch");
}
The text was updated successfully, but these errors were encountered:
Thanks! We don't mirror or track libgit2 issues here, so I'm going to close this as it does look like an upstream issue. If it gets fixed, we'll pick the fix up in the next update.
How to reproduce:
Estimated behaviour: index remain unchanged. no changes staged.
Current behaviour: old file deleted from index.
The text was updated successfully, but these errors were encountered: