File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -717,7 +717,10 @@ def tag(name, *opts)
717
717
arr_opts << '-d' if opts [ :d ] || opts [ :delete ]
718
718
arr_opts << name
719
719
arr_opts << target if target
720
- arr_opts << "-m #{ opts [ :m ] || opts [ :message ] } " if opts [ :m ] || opts [ :message ]
720
+
721
+ if opts [ :m ] || opts [ :message ]
722
+ arr_opts << '-m' << ( opts [ :m ] || opts [ :message ] )
723
+ end
721
724
722
725
command ( 'tag' , arr_opts )
723
726
end
Original file line number Diff line number Diff line change @@ -65,12 +65,21 @@ def test_tags
65
65
assert_equal ( tag1 . tagger . name , 'Test User' )
66
66
assert_equal ( tag1 . tagger . email , 'test@email.com' )
67
67
assert_true ( ( Time . now - tag1 . tagger . date ) < 10 )
68
- assert_equal ( tag1 . message , ' test message' )
69
-
68
+ assert_equal ( tag1 . message , 'test message' )
69
+
70
70
tag2 = r2 . tag ( 'fifth' )
71
71
assert_false ( tag2 . annotated? )
72
72
assert_equal ( tag2 . tagger , nil )
73
73
assert_equal ( tag2 . message , nil )
74
74
end
75
75
end
76
+
77
+ def test_tag_message_not_prefixed_with_space
78
+ in_temp_dir do |path |
79
+ repo = Git . clone ( @wbare , 'repo1' )
80
+ repo . add_tag ( 'donkey' , :annotated => true , :message => 'hello' )
81
+ tag = repo . tag ( 'donkey' )
82
+ assert_equal ( tag . message , 'hello' )
83
+ end
84
+ end
76
85
end
You can’t perform that action at this time.
0 commit comments