Switches to "master" even if the default branch is "main"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
codetree |
Triaged
|
Low
|
Unassigned |
Bug Description
Git repositories whose default branch is "main" use "main" when initially cloned, as expected. But on subsequent updates, the branch is switched to "master" with message "revno and branch are not specified. Setting to 'master'.". This will result in: an error if master does not exist; or even worse, silently switch to a non-default, possibly obsolete "master" branch if it still exists.
$ cat codetree.conf
htop git+https:/
$ ls htop
ls: cannot access 'htop': No such file or directory
$ codetree codetree.conf
Cloning repository at htop from https:/
Repository htop at revision 09bf230e4fd3134
Updating submodules in repository htop
$ git -C htop branch
* main
$ codetree codetree.conf
Updating repository at htop from refs/remotes/
revno and branch are not specified. Setting to 'master'.
error: pathspec 'master' did not match any file(s) known to git
As a workaround, append ";revno=main" to the repository URL.
Using the codetree snap 1.1.1-0~116 (5) from latest/stable.
summary: |
- Switches to "master" branch even if the default is "main" + Switches to "master" even if the default branch is "main" |
Changed in codetree: | |
status: | New → Triaged |
Probably introduced by https:/ /code.launchpad .net/~cjwatson/ codetree/ default- branch/ +merge/ 411856