| 219 | |
| 220 | #[test] |
| 221 | fn no_mismatch_when_index_lives_in_same_worktree() { |
| 222 | let tmp = tempdir().unwrap(); |
| 223 | let project = tmp.path().join("repo"); |
| 224 | fs::create_dir_all(&project).unwrap(); |
| 225 | run_git(&project, &["init", "--quiet"]); |
| 226 | // start_path is inside the same working tree as the index |
| 227 | let sub = project.join("src"); |
| 228 | fs::create_dir_all(&sub).unwrap(); |
| 229 | assert!(detect_worktree_index_mismatch(&sub, &project).is_none()); |
| 230 | } |
| 231 | |
| 232 | #[test] |
| 233 | fn flags_mismatch_when_started_from_linked_worktree() { |