File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change 1
1
//! sync git api (various methods)
2
2
3
- use git2:: { IndexAddOption , Repository , RepositoryOpenFlags } ;
3
+ use git2:: { Repository , RepositoryOpenFlags } ;
4
4
use scopetime:: scope_time;
5
5
use std:: path:: Path ;
6
6
@@ -70,19 +70,7 @@ pub fn stage_add(repo_path: &str, path: &Path) -> bool {
70
70
71
71
let mut index = repo. index ( ) . unwrap ( ) ;
72
72
73
- let cb = & mut |p : & Path , _matched_spec : & [ u8 ] | -> i32 {
74
- if p == path {
75
- 0
76
- } else {
77
- 1
78
- }
79
- } ;
80
- let cb = Some ( cb as & mut git2:: IndexMatchedPath ) ;
81
-
82
- let flags = IndexAddOption :: DISABLE_PATHSPEC_MATCH
83
- | IndexAddOption :: CHECK_PATHSPEC ;
84
-
85
- if index. add_all ( path, flags, cb) . is_ok ( ) {
73
+ if index. add_path ( path) . is_ok ( ) {
86
74
index. write ( ) . unwrap ( ) ;
87
75
return true ;
88
76
}
You can’t perform that action at this time.
0 commit comments