File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -196,13 +196,23 @@ impl Repository {
196196 file_path. to_string ( )
197197 } ;
198198
199+ // do this before normalizing the path
200+ let abs_file_path = repo_root. join ( & relative_file_path) ;
201+
202+
199203 #[ cfg( windows) ]
200- let relative_file_path = normalize_to_posix ( & relative_file_path) ;
204+ let relative_file_path = {
205+ let normalized = normalize_to_posix ( & relative_file_path) ;
206+ // Strip leading ./ or .\ if present
207+ normalized. strip_prefix ( "./" ) . unwrap_or ( & normalized) . to_string ( )
208+ } ;
201209
202210 #[ cfg( not( windows) ) ]
203- let relative_file_path = relative_file_path;
211+ let relative_file_path = {
212+ // Also strip leading ./ on non-Windows for consistency
213+ relative_file_path. strip_prefix ( "./" ) . unwrap_or ( & relative_file_path) . to_string ( )
214+ } ;
204215
205- let abs_file_path = repo_root. join ( & relative_file_path) ;
206216
207217 // Validate that the file exists
208218 if !abs_file_path. exists ( ) {
You can’t perform that action at this time.
0 commit comments