Don't add paths outside the repository even with --force
Dependencies
- [2]
3SJ3DJNFAdding a --force option to `pijul add`, to include otherwise ignored files - [3]
TPQHDDNCpijul add --force know adds ignored files - [4]
3J6IK4W2Explicitly adding .pijul is now forbidden - [5]
4VWXL6KQCorrect handling of ignore files - [6]
AFWNXPBKPrevent the addition of .pijul to the repository - [7]
ZHABNS3SCanonicalize all paths - [8]
4OCC6D42Recursive add - [*]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting).
Change contents
- replacement in pijul/src/commands/file_operations.rs at line 141
if !self.force&& !libpijul::working_copy::filesystem::filter_ignore(repo_path.as_ref(),path.as_ref(),meta.is_dir(),){if !libpijul::working_copy::filesystem::filter_path(repo_path.as_ref(),path.as_ref(),meta.is_dir(),!self.force,) { - edit in libpijul/src/working_copy/filesystem.rs at line 11[10.209107][3.1013]
}/// Returns whether `path` is eligible to be tracked in the repository under `root`.pub fn filter_path(root: &CanonicalPath,path: &CanonicalPath,is_dir: bool,use_ignore: bool,) -> bool {if !path.starts_with(root) {return false;}if use_ignore && !filter_ignore(root, path, is_dir) {return false;}true - replacement in libpijul/src/working_copy/filesystem.rs at line 272
if !force {if !filter_ignore(&repo_path.as_canonical_path(),&full.as_canonical_path(),meta.is_dir(),) {return Ok(Untracked {join: None,receiver,});}if !filter_path(&repo_path.as_canonical_path(),&full.as_canonical_path(),meta.is_dir(),!force,) {return Ok(Untracked {join: None,receiver,});