backends/git: Simplified fallback branch handling
backends/git: Removed duplicate "git fetch" call

"git fetch -t" is fetching *only* the tags, while "git fetch" is fetching
branches *and* tags already.
backends/git: Extracted repo_url_changed() method
backends/git: Extracted repo_exists() method
backends/git: Extracted local revision variable
backends/git: Fixed warning message in reset() method

"git reset" is not really related to getting code from a remote repository
backends/git: Added optional revision parameter to reset() method
backends/git: Use reset(identifier) in checkout() method
backends/git: Renamed pull() to fetch()

We are using "git fetch" here, not "git pull". The method name was a bit
misleading, since both commands have slightly different meanings.
backends/git: Update remote url instead of cloning again

There is no need to throw away all the commits that we already have.
backends/git: Added find_ref() and ref_exists() methods

Make sure to reset to the right revision (i.e. origin/master, not master)
backends/git: Merge update() and checkout() code

... and fix submodule handling in the process.

Submodules can only be updated once the parent repo and working dir is in
the right state. So before the "git submodule" commands are run, we need
to "git reset" the repo to the requested revision.
backends/git: Simplified remote URL updates

We can simply set the remote URL before each fetch to make sure we always
use the right URL.
backends/git: Use "git checkout" instead of "git reset"

We can working with a detached HEAD instead of moving the master branch
around
backends/git: Added 'origin/' prefix fast path to find_ref() method
backends/git: Use "--force" for submodule updates

Make sure the working dir is definitely updated with any changes
backends/git: Use "--quite" checkout to suppress "detached HEAD" warning

We know about the detached HEAD and are doing this on purpose.
backends/git: Import cleanup
backends/git: Simplified find_ref() method

as discussed with @wraithan in #658
Merge pull request #658 from Turbo87/git

Git Backend refactoring and improvements