Deleting the default branch using git causes problems.
Created by: nickpalmer
Summary: Deleting the default branch using git causes the GitLab "Files", "Commits" and "Network" tabs to vanish. It seems like the repo is empty but it still exists on disk and push and pull still work correctly.
Steps to reproduce:
- Push a test branch:
git checkout -b test
git push origin test
- Set "test" as the default branch. Go into the gitlab UI and select "Settings" for the project. Set the "Default Branch" to "test". Hit the "Save" button.
- Now delete the branch:
git push origin :test
- Return to the gitlab UI and refresh. Note that "Files", "Commits" and "Network" have vanished!
- Note that "Settings" doesn't even show the "Default Branch" picker. So there is no way from the UI to even fix the problem.
Work around is to go into the database and update the default branch in the projects table by hand, but this kind of sucks.
Expected Behavior: Maybe a warning that the default branch doesn't exist and needs to be reset in settings.
Observed Behavior: The repo appears to be empty but actually isn't.
Output of Checks:
$ bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.4.0 ? ... OK (1.4.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
Server / xxx-ng ... ok
Android / xxx-workspace-android ... ok
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... no
Try fixing it:
Install the init script
For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors
Projects have satellites? ...
Server / xxx-ng ... yes
Android / xxx-workspace-android ... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.2)
Checking GitLab ... Finished
Note that we don't use an init script to launch gitlab.
Gitlab version: commit 26ed59f1 Author: Dmitriy Zaporozhets [email protected] Date: Mon Jun 10 18:16:09 2013 +0300
v5.2.1