Skip to content

Commit df3e68c

Browse files
committed
[BENCHMARKING] Use Regexp to get branch name instead
1 parent bb68548 commit df3e68c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

profile/benchmarking/results.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
require 'pry-nav'
1819
module Elasticsearch
1920
module Benchmarking
2021

@@ -201,11 +202,12 @@ def adapter
201202

202203
def git_doc
203204
sha = `git rev-parse HEAD`
204-
branch = `git branch | grep \\* | cut -d ' ' -f2`
205+
branch = /\* (.+)/.match(`git branch`)[1]
205206
commit_message = `git log -1 --pretty=%B`
206207
repository = 'elasticsearch-ruby'
207208

208-
{ branch: branch.chomp,
209+
210+
{ branch: branch,
209211
sha: sha.chomp,
210212
commit_message: commit_message.chomp,
211213
repository: repository.chomp }

0 commit comments

Comments
 (0)