Reputation: 9969
In a git repository. I want to get the number of commits against remote origin
's master branch:
remote = 'origin'
system %W[git rev-list HEAD...#{remote}/master --count]
This will result in ArgumentError: wrong first argument
.
But git rev-list HEAD...#{remote}/master --count
works.
what's wrong with my first argument?
Upvotes: 6
Views: 1161
Reputation: 9969
Need to use splat operator to convert the array to method parameters:
system *%W[git rev-list HEAD...#{remote}/master --count]
Upvotes: 9