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