Mostly stylistic, but I'd pull out the conditional here:

``` ruby
if params[:refChanges]
  ref = ...
  sha = ...
else
  ref = ...
  sha = ...
end
```