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?
Need to use splat operator to convert the array to method parameters:
system *%W[git rev-list HEAD...#{remote}/master --count]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With