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