Switches to "master" even if the default branch is "main"

Bug #1997115 reported by Maximiliano Bertacchini
6
This bug affects 1 person
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://github.com/htop-dev/htop.git

  $ ls htop
  ls: cannot access 'htop': No such file or directory

  $ codetree codetree.conf
  Cloning repository at htop from https://github.com/htop-dev/htop.git
  Repository htop at revision 09bf230e4fd313477e90178f87d6fcd757f01d1a
  Updating submodules in repository htop

  $ git -C htop branch
  * main

  $ codetree codetree.conf
  Updating repository at htop from refs/remotes/origin/main
  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"
Revision history for this message
Benjamin Allot (ballot) wrote :
Changed in codetree:
importance: Undecided → Low
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

> Probably introduced by https://code.launchpad.net/~cjwatson/codetree/default-branch/+merge/411856

Actually, that fixed it! But the snap is too old (even on edge). We just need a new snap build :)

Junien F (axino)
Changed in codetree:
status: New → Triaged
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.