File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,24 @@ def branches
189
189
def branch ( branch_name = 'master' )
190
190
Git ::Branch . new ( self , branch_name )
191
191
end
192
+
193
+ # returns +true+ if the branch exists locally
194
+ def is_local_branch? ( branch )
195
+ branch_names = self . branches . local . map { |b | b . name }
196
+ branch_names . include? ( branch )
197
+ end
198
+
199
+ # returns +true+ if the branch exists remotely
200
+ def is_remote_branch? ( branch )
201
+ branch_names = self . branches . local . map { |b | b . name }
202
+ branch_names . include? ( branch )
203
+ end
204
+
205
+ # returns +true+ if the branch exists
206
+ def is_branch? ( branch )
207
+ branch_names = self . branches . map { |b | b . name }
208
+ branch_names . include? ( branch )
209
+ end
192
210
193
211
# returns a Git::Remote object
194
212
def remote ( remote_name = 'origin' )
You can’t perform that action at this time.
0 commit comments