Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

[BUG] Cannot synchronize repo if branch is named "main" even after changing branch name in settings #2273

@AkechiShiro

Description

@AkechiShiro

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 :

  1. Changing the branch name to main in the settings according to Add ability to change default branch #977.
  2. In settings Git local configuration, press hard reset of the remote branch.
  3. that still did not make the error go away, but did synchronize the repo it seems.
  4. I see that in the Git local configuration -> Utilities still shows on branch master despite the main branch being configured in Git server settings.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to Git server
  2. Rename your branch from master to any other name.
  3. Changing or not changing the Git server settingsbranch to main instead of master as shown in Add ability to change default branch #977
  4. Go to Password Store App
  5. Try and synchronize.
  6. 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 settingsUtilities, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-GitArea: GitC-bugCategory: This is a bugE-mediumEffort: This requires a fair amount of workP-highPriority: high, must be resolved before next major release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions