git-subrepo
git-subrepo copied to clipboard
Cannot change tracking branch if two branches point to the same hash
In one of my subrepos I've branched test2 off of master. Neither of them has any new commits so they effectively point to the same hash.
> git subrepo status
1 subrepo:
Git subrepo 'myrepo':
Subrepo Branch: subrepo/myrepo
Remote URL: [email protected]:zzz/xxx.git
Upstream Ref: 66e98f3
Tracking Branch: test2
Pulled Commit: 66e98f3
Pull Parent: 7e41165
When I try changing the tracking branch to master I get:
git subrepo pull -b master --force --update myrepo
Subrepo 'myrepo' pulled from '[email protected]:zzz/xxx.git' (master).
But git subrepo status still shows:
1 subrepo:
Git subrepo 'myrepo':
Subrepo Branch: subrepo/myrepo
Remote URL: [email protected]:zzz/xxx.git
Upstream Ref: 66e98f3
Tracking Branch: test2
Pulled Commit: 66e98f3
Pull Parent: 7e41165
Expected result
> git subrepo status
1 subrepo:
Git subrepo 'myrepo':
Subrepo Branch: subrepo/myrepo
Remote URL: [email protected]:zzz/xxx.git
Upstream Ref: 66e98f3
Tracking Branch: master
Pulled Commit: 66e98f3
Pull Parent: c7c19cd
Workaround
Change the tracking branch to some other branch (that points to another commit) first and then change it again to the target one.
Can confirm that I am also running into this issue