More fixes in version detection logic in the gitrepo driver
More fixes in version detection logic in the gitrepo driver

The previous commit did not fix detection logic, and actually broke
it for cases where the previous usage of the upstream_version()
macro was in use. The new fix detects the newer usage, and does not
set a version in that case (we only want to use it when chasing
the head of a git repo).

This reverts commit dc6f376445a9901f53271d13ca8de90dc1fd519a.

Change-Id: Ia0c462d7c400a39dbca5d76d4a4f1aaadca0ce84

openstack-packages/DLRN,openstack-packages/delorean,openstack-packages/delorean,openstack-packages/DLRN