-
-
Notifications
You must be signed in to change notification settings - Fork 307
[BUG] Cannot synchronize repo if branch is named "main" even after changing branch name in settings #2273
Description
Describe the bug
My bug is similar to #147, and related to #1785
The error, I'm getting, is
An exception occurred during a git operation: Could not get advertised Ref for branch
master.
My repo has no branch master but only a branch main, is this hard-coded or intended that the only branch that will get synced is master ?
Workaround:
I managed to sync :
- Changing the branch name to
mainin the settings according to Add ability to change default branch #977. - In settings
Git local configuration, presshard reset of the remote branch. - that still did not make the error go away, but did synchronize the repo it seems.
- I see that in the
Git local configuration->Utilitiesstill showson branch masterdespite themainbranch being configured inGit server settings.
Steps to reproduce
Steps to reproduce the behavior:
- Go to Git server
- Rename your branch from master to any other name.
- Changing or not changing the
Git server settings⇾branchtomaininstead ofmasteras shown in Add ability to change default branch #977 - Go to Password Store App
- Try and synchronize.
- See error
Expected behavior
I believe the most correct behavior should be to ask the user which branch he wishes to synchronize, or to synchronize the only branch that exist in the repo.
In my case I only have one branch main and so it should be selected instead of trying master by default.
Another issue is that in Git local settings ⇾ Utilities, it should be shown on branch main, not master anymore.
Screenshots
No response
Device information
- Device: Xiaomi Poco F3
- OS: stock ROM Android version 13
- App version: 1.13.5
Additional context
I've noticed a second issue, on a device where I already synced when the master branch existed, now after having renamed the master to main, it no longer works and shows :
A git exception occured: Could not get advertised Ref for branch refs/heads/master
I believe this is similar to #1785, I can open a separate issue for the step to reproduce it.