Only update-reset if remote repository has master branch

This fixes errors on empty repositories.

Change-Id: I4d4da20836b24d6e34151d78b18285deb659eecb
Merge "Only update-reset if remote repository has master branch"