()
| 300 | |
| 301 | #[test] |
| 302 | fn git_glob_after_commit() { |
| 303 | let repo = init_bare_repo(); |
| 304 | let mut odb = LocalGitOdb::from_commit(repo.path().to_path_buf(), String::new()).unwrap(); |
| 305 | |
| 306 | odb.put("a/x.rs", &b"fn x(){}".to_vec()).unwrap(); |
| 307 | odb.put("a/y.rs", &b"fn y(){}".to_vec()).unwrap(); |
| 308 | odb.put("b/z.md", &b"# Z".to_vec()).unwrap(); |
| 309 | let commit_sha = odb.commit(&[] as &[&str], "add files", None, None).unwrap(); |
| 310 | |
| 311 | let odb = LocalGitOdb::from_commit(repo.path().to_path_buf(), commit_sha).unwrap(); |
| 312 | let mut matches = odb.glob("a/*.rs").unwrap(); |
| 313 | matches.sort(); |
| 314 | assert_eq!(matches, vec!["a/x.rs", "a/y.rs"]); |
| 315 | } |
| 316 | |
| 317 | #[test] |
| 318 | fn git_commit_with_parent() { |
nothing calls this directly
no test coverage detected