| 358 | } |
| 359 | |
| 360 | fn collect_tracked_paths( |
| 361 | root: &Path, |
| 362 | parent_oid: Option<&str>, |
| 363 | ) -> Result<BTreeSet<Vec<u8>>, WipCaptureError> { |
| 364 | let mut paths = split_nul(git_bytes( |
| 365 | root, |
| 366 | "list live-index paths", |
| 367 | &os_args(&["ls-files", "--cached", "-z"]), |
| 368 | None, |
| 369 | None, |
| 370 | )?) |
| 371 | .into_iter() |
| 372 | .collect::<BTreeSet<_>>(); |
| 373 | |
| 374 | if let Some(parent_oid) = parent_oid { |
| 375 | let args = vec![ |
| 376 | OsString::from("ls-tree"), |
| 377 | OsString::from("-r"), |
| 378 | OsString::from("-z"), |
| 379 | OsString::from("--name-only"), |
| 380 | OsString::from(parent_oid), |
| 381 | ]; |
| 382 | paths.extend(split_nul(git_bytes( |
| 383 | root, |
| 384 | "list HEAD paths", |
| 385 | &args, |
| 386 | None, |
| 387 | None, |
| 388 | )?)); |
| 389 | } |
| 390 | |
| 391 | Ok(paths) |
| 392 | } |
| 393 | |
| 394 | fn initialize_alternate_index( |
| 395 | root: &Path, |