We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
resolve_symlink
1 parent 6b8a696 commit e8cccc4Copy full SHA for e8cccc4
1 file changed
src/app/deduplicate_arguments.rs
@@ -144,9 +144,17 @@ mod tests {
144
"absolute_path should be absolute: {absolute_path:?}",
145
);
146
for &(link_path, link_target) in MOCKED_SYMLINKS {
147
- if let Ok(suffix) = absolute_path.strip_prefix(link_path) {
148
- return link_target
149
- .pipe(PathBuf::from)
+ let link_path = PathBuf::from(link_path);
+ assert!(
+ link_path.is_absolute(),
150
+ "link_path should be absolute: {link_path:?}",
151
+ );
152
+ let Some(parent) = link_path.parent() else {
153
+ panic!("Cannot get parent of {link_path:?}");
154
+ };
155
+ if let Ok(suffix) = absolute_path.strip_prefix(&link_path) {
156
+ return parent
157
+ .join(link_target)
158
.join(suffix)
159
.normalize()
160
.pipe(resolve_symlink);
0 commit comments