File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ def added
58
58
# added?('lib/git.rb')
59
59
# @return [Boolean]
60
60
def added? ( file )
61
- added . member? ( file )
61
+ if ignore_case?
62
+ added . keys . map ( &:downcase ) . include? ( file . downcase )
63
+ else
64
+ added . member? ( file )
65
+ end
62
66
end
63
67
64
68
#
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ def test_dot_files_status
92
92
def test_added_boolean
93
93
in_temp_dir do |path |
94
94
git = Git . clone ( @wdir , 'test_dot_files_status' )
95
+ git . config ( 'core.ignorecase' , 'false' )
95
96
96
97
create_file ( 'test_dot_files_status/test_file_1' , 'content tets_file_1' )
97
98
create_file ( 'test_dot_files_status/test_file_2' , 'content tets_file_2' )
@@ -100,6 +101,10 @@ def test_added_boolean
100
101
101
102
assert ( git . status . added? ( 'test_file_1' ) )
102
103
assert ( !git . status . added? ( 'test_file_2' ) )
104
+ assert ( !git . status . added? ( 'TEST_FILE_1' ) )
105
+
106
+ git . config ( 'core.ignorecase' , 'true' )
107
+ assert ( git . status . added? ( 'TEST_FILE_1' ) )
103
108
end
104
109
end
105
110
You can’t perform that action at this time.
0 commit comments