Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the default git branch from "main" to "master" breaks SCM #1467

Closed
hackman opened this issue Dec 4, 2020 · 2 comments · Fixed by #1470
Closed

Changing the default git branch from "main" to "master" breaks SCM #1467

hackman opened this issue Dec 4, 2020 · 2 comments · Fixed by #1470
Assignees

Comments

@hackman
Copy link

hackman commented Dec 4, 2020

Issue description

I wanted to have all my git repos with "master" as default branch, so I went to the git setting page and replaced "main" with "master".

As soon as I changed that I tested a creation of a repository with the initialize repo option selected.
When I click create I'm presented with this error:

Illegal input

The values could not be validated. Please correct your input and try again.

Violations:

    create.repository.type: must not be empty 

Transaction ID FaSIELWKQ1m
Error Code 1wR7ZBe7H1

Even if I create the repo without initializing it, I can't create the master branch from the interface.
If I push the new master branch from my PC, I can now use the repo, however, on every push to the "master" branch, now I'm presented with:

(master):~/Projects/tool$ git push
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 283 bytes | 283.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1)
remote: Updating references: 100% (1/1)
remote: [SCM] 
remote: [SCM] Create new pull request for branch master:
remote: [SCM] https://somedomain.here/scm/repo/user/tool/pull-requests/add/changesets/?source=master
remote: [SCM] 
To ssh://somedomain.here/repo/user/tool
   924f59e..065e5a6  master -> master

Bug Report

Describe how to reproduce the bug

Go to Administration -> Settings -> Git, then change the "Default Branch" from main to master.

Now try to create a git repo with "Initialize repository" selected.

For the second problem, after you have set the Default Branch to master, create a git repository without the "Initialize repository" option. Then create a local repository on your PC, with default branch "master". Then add and commit a file in your local repo. Finally push to the SCM repo. You will be presented with the following:

(master):~/Projects/test1$ git push
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 263 bytes | 263.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Updating references: 100% (1/1)
remote: [SCM]
remote: [SCM] Create new pull request for branch master:
remote: [SCM] https://repo.whc.ca/scm/repo/user/test1/pull-requests/add/changesets/?source=master
remote: [SCM]
To ssh://somedomain.here/repo/user/test1
   9679df2..5c64d3c  master -> master

If you add more commits and push, you will be again asked to create a pull request for your "master" branch.

(master):~/Projects/test1$ git push
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 247 bytes | 247.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Updating references: 100% (1/1)
remote: [SCM]
remote: [SCM] Create new pull request for branch master:
remote: [SCM] https://somedomain.here/scm/repo/user/test1/pull-requests/add/changesets/?source=master
remote: [SCM]
To ssh://somedomain.here/repo/user/test1
   5c64d3c..48ef964  master -> master


Which operating system, browser and versions do you use?

Linux, Firefox
SCM-Manager 2.10.0

@pfeuffer
Copy link
Member

pfeuffer commented Dec 7, 2020

I can reproduce this. Thank you very much for the report!

@pfeuffer pfeuffer self-assigned this Dec 7, 2020
pfeuffer added a commit that referenced this issue Dec 7, 2020
Fixes issue #1467
where initialization fails when master is set as default branch.
pfeuffer added a commit that referenced this issue Dec 7, 2020
Fixes issue #1467
where initialization fails when master is set as default branch.
pfeuffer added a commit that referenced this issue Dec 7, 2020
Fixes issue #1467
where initialization fails when master is set as default branch.
sdorra pushed a commit that referenced this issue Dec 7, 2020
Fixes issue #1467
where initialization fails when master is set as default branch.
@pfeuffer
Copy link
Member

pfeuffer commented Dec 7, 2020

Hi @hackman , we released a fixed version 2.11.1. Here the bug should be fixed that you cannot initialize a repository when the default branch is set to master.

I've created a new issue in the review plugin repository for the useless link in the push response (scm-manager/scm-review-plugin#112).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants