change in git branch has no effect for existing repo

Bug #1892101 reported by Paul Collins
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
codetree
Confirmed
High
Unassigned

Bug Description

Recently I updated a collect file to fetch from a specified branch instead of the default branch.

"mojo collect" still finished successfully but the repo remained on the original branch.

At a minimum, I would expect codetree to switch the repository to the new branch, but I also would expect it to complain about the change in source, much as it does when the source itself is changed, and to require overwrite=True (or rm -rf) to proceed.

$ cat $MOJO_SPEC/$MOJO_STAGE/../collect
mattermost git+https://git.launchpad.net/charm-k8s-mattermost;branch=built
$ mojo collect
[...]
2020-08-18 22:25:21 [INFO] Updating repository at mattermost from refs/remotes/origin/master
2020-08-18 22:25:21 [INFO] Repository mattermost at revision 2b68f795ca392937568a21349d56c61e15892d49
[...]
$ git -C /srv/mojo/mojo-prod-mattermost/xenial/production/build/mattermost branch
* master
$ rm -rf /srv/mojo/mojo-prod-mattermost/xenial/production/build/mattermost
$ rm -rf /srv/mojo/mojo-prod-mattermost/xenial/production/charms/xenial/mattermost
$ mojo collect
[...]
2020-08-18 22:35:14 [INFO] Cloning repository at mattermost from https://git.launchpad.net/charm-k8s-mattermost
2020-08-18 22:35:15 [INFO] Repository mattermost at revision b261ac7a54e390bb0f0e2b8a5db911786ebb2a91
[...]
$ git -C /srv/mojo/mojo-prod-mattermost/xenial/production/build/mattermost branch
* built
$ _

Paul Collins (pjdc)
description: updated
Changed in codetree:
status: New → Confirmed
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.