Correctly translate all branches/tags/shas:

The code which raises an error if two elements try
to install different versions of the same git repo
currently works correctly for SHAs, or if a branch
is specified first, followed by a SHA.

However it fails if two branches are specified, because
the shallow clone does not fetch all branch heads.

This change correctly handles any combination of
SHAs/branch-heads/tags.

Change-Id: I501e94150ddeb41b79588816576a5d7a06fa92aa