backends/git: Import cleanup
backends/git: Simplified find_ref() method

as discussed with @wraithan in #658