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 @@ -37,7 +37,7 @@ static int abspath_part_inside_repo(char *path)
37
37
off = offset_1st_component (path );
38
38
39
39
/* check if work tree is already the prefix */
40
- if (wtlen <= len && !strncmp (path , work_tree , wtlen )) {
40
+ if (wtlen <= len && !fspathncmp (path , work_tree , wtlen )) {
41
41
if (path [wtlen ] == '/' ) {
42
42
memmove (path , path + wtlen + 1 , len - wtlen );
43
43
return 0 ;
@@ -57,7 +57,7 @@ static int abspath_part_inside_repo(char *path)
57
57
path ++ ;
58
58
if (* path == '/' ) {
59
59
* path = '\0' ;
60
- if (strcmp (real_path (path0 ), work_tree ) == 0 ) {
60
+ if (fspathcmp (real_path (path0 ), work_tree ) == 0 ) {
61
61
memmove (path0 , path + 1 , len - (path - path0 ));
62
62
return 0 ;
63
63
}
@@ -66,7 +66,7 @@ static int abspath_part_inside_repo(char *path)
66
66
}
67
67
68
68
/* check whole path */
69
- if (strcmp (real_path (path0 ), work_tree ) == 0 ) {
69
+ if (fspathcmp (real_path (path0 ), work_tree ) == 0 ) {
70
70
* path0 = '\0' ;
71
71
return 0 ;
72
72
}
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