Skip to content

Repository seems empty after pushing two branches #4919

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

Closed
2 of 7 tasks
lfuerderer opened this issue Sep 12, 2018 · 3 comments · Fixed by #4923
Closed
2 of 7 tasks

Repository seems empty after pushing two branches #4919

lfuerderer opened this issue Sep 12, 2018 · 3 comments · Fixed by #4923
Labels
Milestone

Comments

@lfuerderer
Copy link

Description

When I create a new, empty repository in the web view and push two branches at the same time using one git push command, the repository still appears empty in the web view.

Steps to reproduce

  1. Create a new repository with the web browser. Leave the checkbox "Initialize Repository" empty.

  2. Clone the repository and create a commit.

     lukas@laptop:~$ git clone https://try.gitea.io/LukasFuerderer/Test.git
     Klone nach 'Test' ...
     Username for 'https://try.gitea.io': LukasFuerderer
     Password for 'https://LukasFuerderer@try.gitea.io': 
     warning: Sie scheinen ein leeres Repository geklont zu haben.
     Prüfe Konnektivität ... Fertig.
     lukas@laptop:~$ cd Test
     lukas@laptop:~/Test$ touch dummy
     lukas@laptop:~/Test$ git add dummy
     lukas@laptop:~/Test$ git commit -m "Create dummy file"
     [master (Basis-Commit) 518f855] Create dummy file
      1 file changed, 0 insertions(+), 0 deletions(-)
      create mode 100644 dummy
     lukas@laptop:~/Test$
    
  3. Create a second branch.

     lukas@laptop:~/Test$ git branch branch2
     lukas@laptop:~/Test$
    
  4. Push both branches using only one push command.

     lukas@laptop:~/Test$ git push origin master branch2
     Username for 'https://try.gitea.io': LukasFuerderer
     Password for 'https://LukasFuerderer@try.gitea.io': 
     Zähle Objekte: 3, Fertig.
     Schreibe Objekte: 100% (3/3), 222 bytes | 0 bytes/s, Fertig.
     Total 3 (delta 0), reused 0 (delta 0)
     To https://try.gitea.io/LukasFuerderer/Test.git
      * [new branch]      master -> master
      * [new branch]      branch2 -> branch2
     lukas@laptop:~/Test$
    

Both branches are now pushed to the git repository in the background. If I clone the repository to a new location, they are visible.

But the web view still shows an empty repository. I can see the "Quick Guide" giving instructions how to create the first commit.

Screenshots

Creating the repository:
create-repo

After pushing both branches:
after-push

@lafriks
Copy link
Member

lafriks commented Sep 12, 2018

Does it work for you with single branch?

@lfuerderer
Copy link
Author

Yes, with a single branch everything is fine.
Only if there are at least two new branches on the first push to the repository, the error occurs.

@lfuerderer
Copy link
Author

Update: There seems to be another condition that I did not recognize before.

To reproduce this bug, every branch that is part of the first push must point to the same commit. In the scenario I described above, I have two branches on the same commit so the condition is fulfilled.

@lafriks lafriks added this to the 1.5.2 milestone Sep 12, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants