Canonicalise the source path when cloning a local source

pmeunier
Jan 1, 2022, 6:31 PM
FCMAW4GOKAFKDTOCMV2LSG4SSSDI7W2NY7BOV2U3HDDHXF3OFEAAC

Dependencies

  • [2] OPC2VAZD Writing an initial config file at initialisation
  • [3] RGJWLQWB When cloning, try to init *before* setting up the path Drop (pijul::commands::clone::RepoPath)
  • [4] H72JG6HL Init feature; specific .ignore configs
  • [5] LYTVEPH3 Avoid cloning into an existing path
  • [6] RUBBHYZ7 Removing unnecessary async/await
  • [7] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [8] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [9] B3QWIGDE Fixing the Git features with the latest Pijul (+ conflicts in Cargo.toml)
  • [10] SQVWP4LU When clone fails, only remove directories we have created (not other directories)
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in pijul/src/commands/clone.rs at line 75
    [3.167][2.831:911]()
    let mut repo = Repository::init(Some(path), None, Some(&self.remote))?;
    [3.167]
    [3.16742]
    let remote_normalised: std::borrow::Cow<str> = match remote {
    crate::remote::RemoteRepo::Local(_) => std::fs::canonicalize(&self.remote)?
    .to_str()
    .unwrap()
    .to_string()
    .into(),
    _ => self.remote.as_str().into(),
    };
    let mut repo = Repository::init(Some(path), None, Some(&remote_normalised))?;