From 34f2fb6b09a353c2ca9adce8649c0708946bbea6 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Thu, 22 Feb 2024 12:00:56 +0100 Subject: [PATCH] Add a relative path to the lockfile for bender clone All other path dependencies are relative if possible in the lockfile, so we align to this behavior introduced in v0.27.0. --- src/cmd/clone.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmd/clone.rs b/src/cmd/clone.rs index 7aa73da6..45cce1b9 100644 --- a/src/cmd/clone.rs +++ b/src/cmd/clone.rs @@ -222,7 +222,13 @@ pub fn run(sess: &Session, path: &Path, matches: &ArgMatches) -> Result<()> { let mut mod_package = locked.packages[dep].clone(); mod_package.revision = None; mod_package.version = None; - mod_package.source = LockedSource::Path(path.join(path_mod).join(dep)); + mod_package.source = LockedSource::Path( + path.join(path_mod) + .join(dep) + .strip_prefix(path) + .unwrap_or(&path.join(path_mod).join(dep)) + .to_path_buf(), + ); locked.packages.insert(dep.to_string(), mod_package); let file = File::create(path.join("Bender.lock"))