work around ruby 2.2.0 parsing quirk

Ruby 2.2.0 has a problem parsing the File.open() do-end stuff in that multi-line ternary assignment in repo_index.rb's read method.

Replacing the do-end with braces works but it's considered bad form if I'm not mistaken so I factored it all out to a separate method.. Tests pass on MRI rubies 1.9.2 - 2.2.0, latest jruby and rbx..