input paths normalised before comparison
This commit is contained in:
@@ -32,11 +32,12 @@ pub fn add(files: Vec<PathBuf>) -> Result<(), TourError> {
|
|||||||
.open(STAGED_PATH)?;
|
.open(STAGED_PATH)?;
|
||||||
|
|
||||||
for file in &files {
|
for file in &files {
|
||||||
if existing_set.contains(file) {
|
let normalized: PathBuf = file.components().collect();
|
||||||
println!("already staged: {}", file.display());
|
if existing_set.contains(&normalized) {
|
||||||
|
println!("already staged: {}", normalized.display());
|
||||||
} else {
|
} else {
|
||||||
writeln!(staged, "{}", file.display())?;
|
writeln!(staged, "{}", normalized.display())?;
|
||||||
println!("staged: {}", file.display());
|
println!("staged: {}", normalized.display());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user