repo 1.12.16
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAABAgAGBQJTYq/KAAoJEGe35EhpKzgsjq8H/2Rowt45rhSpNVUa+J5py3TM
FE7JQhRR9elW9pKk7t+/Bf5jB6NkGQDlfiUO0FwwLsa8skpKQG+FsrCQabxfA8Wt
/YpWBEpgDOh4yJYzQNeDe9JXzKQTsKkwtWwmNZSgL8lvvAMnqgXiewjygvGuvdDX
DtQeVJFZrMveg7aYMc0a8SwAMIQxl4zBEBIEdX4SFoBLZ6j5P5DHUg4oSMXRL2nA
3mqX4yJnhERVToPxrqRD1PoPOSmBGM4A4w9is7TJMkee/wF1LAi0VqO4PFxxLNlZ
QMPSXZRhj0/TP6sYcFD55VQr2JoRcr8IwNEoMRv0KdRrVx5A2n2vnC3KA6aeshM=
=g10e
-----END PGP SIGNATURE-----
Ensure HEAD is correct when skipping remote fetch

A recent optimization (2fb6466f795eb30c1dfa598501f5b5d2981e6a5f) skips
performing a remote fetch if we already know we have the sha1 we want.
However, that optimization skipped initialization steps that ensure HEAD
points to the correct sha1.  This change makes sure not to skip those
steps.

Here is an example of how to test this change:

"""""""""
url=<manifest url>
branch1=<branch name>
branch2=<branch name>
project=<project with revision set to different sha1 in each branch>

repo init -u $url -b $branch1 --mirror
repo sync $project
first=$(cd $project.git; git rev-parse HEAD)

repo init -b $branch2
repo sync $project
second=$(cd platform/build.git; git rev-parse HEAD)

if [[ $first == $second ]]
then
    echo 'problem!'
else
    echo 'no problem!'
fi
"""""""""
1 file changed