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

"Rename branch" menu item should be disabled before initial commit #459

Closed
Vdragon opened this Issue May 31, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@Vdragon
Contributor

Vdragon commented May 31, 2015

Hi Git Cola developers!

It seems that an empty repo has none branches and is not possible to "rename" them, the "Rename branch" menu item should be disabled at this state since every rename attempt will error with following console output:

error: refname refs/heads/master not found
fatal: Branch rename failed

程式以 128 狀態碼結束

@Vdragon Vdragon added the bug label May 31, 2015

@Vdragon Vdragon changed the title from "Rename branch" menu item should be disable before initial commit to "Rename branch" menu item should be disabled before initial commit Jun 23, 2015

mmargoliono added a commit to mmargoliono/git-cola that referenced this issue Jul 15, 2015

Menu: Disable "Branch" menu in empty repositories
When current working repository is empty (eg: just initialised or cloned
an empty repository), it doesn't make sense to rename or delete local
branch.

For checking whether repository is empty or not, local branches is used.
Alternative considered was:
1. Git log/rev-list and check exit code (Fail when there is remote
branches, bot not local branches)
2. Git count-objects (probably has similar issue with above)

Issue: #459
Reported-By: Vdragon
Signed-off-by: Minarto Margoliono <lie.r.min.g@gmail.com>

mmargoliono added a commit to mmargoliono/git-cola that referenced this issue Jul 15, 2015

Menu: Disable "Branch" menu in empty repositories
When current working repository is empty (eg: just initialised or cloned
an empty repository), it doesn't make sense to rename or delete local
branch.

For checking whether repository is empty or not, local branches is used.
Alternative considered was:
1. Git log/rev-list and check exit code (Fail when there is remote
branches, bot not local branches)
2. Git count-objects (probably has similar issue with above)

Issue: #459
Reported-By: Vdragon
Signed-off-by: Minarto Margoliono <lie.r.min.g@gmail.com>

@davvid davvid closed this in 07440f0 Jul 17, 2015

@Vdragon

This comment has been minimized.

Show comment
Hide comment
@Vdragon

Vdragon Jul 17, 2015

Contributor

@mmargoliono Thanks!

Contributor

Vdragon commented Jul 17, 2015

@mmargoliono Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment