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 @@ -108,7 +108,11 @@ def untracked
108
108
# untracked?('lib/git.rb')
109
109
# @return [Boolean]
110
110
def untracked? ( file )
111
- untracked . member? ( file )
111
+ if ignore_case?
112
+ untracked . keys . map ( &:downcase ) . include? ( file . downcase )
113
+ else
114
+ untracked . member? ( file )
115
+ end
112
116
end
113
117
114
118
def pretty
Original file line number Diff line number Diff line change @@ -207,13 +207,18 @@ def test_untracked_from_subdir
207
207
def test_untracked_boolean
208
208
in_temp_dir do |path |
209
209
git = Git . clone ( @wdir , 'test_dot_files_status' )
210
+ git . config ( 'core.ignorecase' , 'false' )
210
211
211
212
create_file ( 'test_dot_files_status/test_file_1' , 'content tets_file_1' )
212
213
create_file ( 'test_dot_files_status/test_file_2' , 'content tets_file_2' )
213
214
git . add ( 'test_file_2' )
214
215
215
216
assert ( git . status . untracked? ( 'test_file_1' ) )
216
217
assert ( !git . status . untracked? ( 'test_file_2' ) )
218
+ assert ( !git . status . untracked? ( 'TEST_FILE_1' ) )
219
+
220
+ git . config ( 'core.ignorecase' , 'true' )
221
+ assert ( git . status . untracked? ( 'TEST_FILE_1' ) )
217
222
end
218
223
end
219
224
You can’t perform that action at this time.
0 commit comments