File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -428,7 +428,8 @@ def clean(opts = {})
428
428
arr_opts = [ ]
429
429
arr_opts << '--force' if opts [ :force ]
430
430
arr_opts << '-d' if opts [ :d ]
431
-
431
+ arr_opts << '-x' if opts [ :x ]
432
+
432
433
command ( 'clean' , arr_opts )
433
434
end
434
435
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ def test_clean
43
43
g = Git . clone ( @wbare , 'clean_me' )
44
44
Dir . chdir ( 'clean_me' ) do
45
45
new_file ( 'test-file' , 'blahblahbal' )
46
+ new_file ( 'ignored_file' , 'ignored file contents' )
47
+ new_file ( '.gitignore' , 'ignored_file' )
48
+
46
49
g . add
47
50
g . commit ( "first commit" )
48
51
@@ -55,18 +58,24 @@ def test_clean
55
58
56
59
assert ( File . exists? ( 'file-to-clean' ) )
57
60
assert ( File . exists? ( 'dir_to_clean' ) )
58
-
61
+ assert ( File . exists? ( 'ignored_file' ) )
62
+
59
63
g . clean ( :force => true )
60
64
61
65
assert ( !File . exists? ( 'file-to-clean' ) )
62
66
assert ( File . exists? ( 'dir_to_clean' ) )
63
-
67
+ assert ( File . exists? ( 'ignored_file' ) )
68
+
64
69
new_file ( 'file-to-clean' , 'blablahbla' )
65
70
66
71
g . clean ( :force => true , :d => true )
67
72
68
73
assert ( !File . exists? ( 'file-to-clean' ) )
69
74
assert ( !File . exists? ( 'dir_to_clean' ) )
75
+ assert ( File . exists? ( 'ignored_file' ) )
76
+
77
+ g . clean ( :force => true , :x => true )
78
+ assert ( !File . exists? ( 'ignored_file' ) )
70
79
end
71
80
end
72
81
end
You can’t perform that action at this time.
0 commit comments