File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ static int abspath_part_inside_repo(char *path)
39
39
off = offset_1st_component (path );
40
40
41
41
/* check if work tree is already the prefix */
42
- if (wtlen <= len && !strncmp (path , work_tree , wtlen )) {
42
+ if (wtlen <= len && !fspathncmp (path , work_tree , wtlen )) {
43
43
if (path [wtlen ] == '/' ) {
44
44
memmove (path , path + wtlen + 1 , len - wtlen );
45
45
return 0 ;
@@ -59,7 +59,7 @@ static int abspath_part_inside_repo(char *path)
59
59
path ++ ;
60
60
if (* path == '/' ) {
61
61
* path = '\0' ;
62
- if (strcmp (real_path (path0 ), work_tree ) == 0 ) {
62
+ if (fspathcmp (real_path (path0 ), work_tree ) == 0 ) {
63
63
memmove (path0 , path + 1 , len - (path - path0 ));
64
64
return 0 ;
65
65
}
@@ -68,7 +68,7 @@ static int abspath_part_inside_repo(char *path)
68
68
}
69
69
70
70
/* check whole path */
71
- if (strcmp (real_path (path0 ), work_tree ) == 0 ) {
71
+ if (fspathcmp (real_path (path0 ), work_tree ) == 0 ) {
72
72
* path0 = '\0' ;
73
73
return 0 ;
74
74
}
Original file line number Diff line number Diff line change @@ -402,4 +402,11 @@ test_expect_success 'all statuses changed in folder if . is given' '
402
402
test $(git ls-files --stage | grep ^100755 | wc -l) -eq 0
403
403
'
404
404
405
+ test_expect_success MINGW ' path is case-insensitive' '
406
+ path="$(pwd -W)/BLUB" &&
407
+ touch "$path" &&
408
+ downcased="$(echo "$path" | tr A-Z a-z)" &&
409
+ git add "$downcased"
410
+ '
411
+
405
412
test_done
You can’t perform that action at this time.
0 commit comments