File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -285,8 +285,8 @@ def fetch(remote = 'origin')
285
285
#
286
286
# @git.config('remote.remote-name.push', 'refs/heads/master:refs/heads/master')
287
287
#
288
- def push ( remote = 'origin' , branch = 'master' )
289
- self . lib . push ( remote , branch )
288
+ def push ( remote = 'origin' , branch = 'master' , tags = false )
289
+ self . lib . push ( remote , branch , tags )
290
290
end
291
291
292
292
# merges one or more branches into the current working branch
Original file line number Diff line number Diff line change @@ -507,8 +507,9 @@ def fetch(remote)
507
507
command ( 'fetch' , remote . to_s )
508
508
end
509
509
510
- def push ( remote , branch = 'master' )
510
+ def push ( remote , branch = 'master' , tags = false )
511
511
command ( 'push' , [ remote . to_s , branch . to_s ] )
512
+ command ( 'push' , [ '--tags' , remote . to_s ] ) if tags
512
513
end
513
514
514
515
def tag_sha ( tag_name )
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ def test_push
53
53
new_file ( 'test-file1' , 'blahblahblah1' )
54
54
loc . add
55
55
loc . commit ( 'master commit' )
56
+ loc . add_tag ( 'test-tag' )
56
57
57
58
loc . branch ( 'testbranch' ) . in_branch ( 'tb commit' ) do
58
59
new_file ( 'test-file3' , 'blahblahblah3' )
@@ -67,12 +68,16 @@ def test_push
67
68
68
69
assert ( rem . status [ 'test-file1' ] )
69
70
assert ( !rem . status [ 'test-file3' ] )
71
+ assert_raise Git ::GitTagNameDoesNotExist do
72
+ rem . tag ( 'test-tag' )
73
+ end
70
74
71
- loc . push ( 'testrem' , 'testbranch' )
75
+ loc . push ( 'testrem' , 'testbranch' , true )
72
76
73
77
rem . checkout ( 'testbranch' )
74
78
assert ( rem . status [ 'test-file1' ] )
75
79
assert ( rem . status [ 'test-file3' ] )
80
+ assert ( rem . tag ( 'test-tag' ) )
76
81
end
77
82
end
78
83
You can’t perform that action at this time.
0 commit comments