Skip to content

ability to delete remote branch #838

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

Merged
merged 7 commits into from
Aug 15, 2021
Merged

ability to delete remote branch #838

merged 7 commits into from
Aug 15, 2021

Conversation

zcorniere
Copy link
Contributor

This MR aim to fix #622.

Please comment, and I will do my best to fix what's wrong.

@zcorniere zcorniere changed the title added ability to delete remote branch ability to delete remote branch Aug 11, 2021
Copy link
Collaborator

@extrawurst extrawurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi thanks for tackling this. I have just added a few inline comments and I have one request: please add a unitest for the push version that deletes an upstream branch

Copy link
Collaborator

@extrawurst extrawurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow that was fast, just a few small improvements to make the test more readable

@extrawurst
Copy link
Collaborator

lgtm now! Thanks ❤️

@extrawurst
Copy link
Collaborator

I just tested the branch a bit and one thing that is a problem is:

Error: git error:cannot locate local branch 'fix-708-expand-recursive'; class=Reference (4); code=NotFound (-3)

Caused by:
    cannot locate local branch 'fix-708-expand-recursive'; class=Reference (4); code=NotFound (-3)

it fails if you wanna delete a remote branch you don't have a local tracking branch for

@zcorniere
Copy link
Contributor Author

Interesting ! I'll look into it !

@zcorniere zcorniere requested a review from extrawurst August 14, 2021 13:34
@extrawurst
Copy link
Collaborator

@zcorniere deleting a remote branch you do not have a local tracking branch for, this still crashes gitui.
here is the log:

10:46:10 [DEBUG] (7) asyncgit::sync::remotes::callbacks: update tips: 'refs/remotes/origin/fix-708-expand-recursive' [4b06621981b116981098b5cad370ee7c9e513a66] [00000000000000000
00000000000000000000000]
10:46:10 [TRACE] (7) scopetime: [scopetime/src/lib.rs:41] scopetime: 1769 ms [asyncgit::sync::remotes::push::push] @asyncgit/src/sync/remotes/push.rs:102
10:46:11 [ERROR] panic: PanicInfo { payload: Any { .. }, message: Some(cast x: f64 to u8 (nearest): range error for x = NaN), location: Location { file: "/Users/stephan/.cargo/re
gistry/src/github.1485827954.workers.dev-1ecc6299db9ec823/easy-cast-0.4.4/src/lib.rs", line: 670, col: 1 } }
trace:
   ...
  13: asyncgit::progress::ProgressPercent::new
             at asyncgit/src/progress.rs:18:24
  14: asyncgit::remote_progress::RemoteProgress::new
             at asyncgit/src/remote_progress.rs:50:23
  15: <asyncgit::remote_progress::RemoteProgress as core::convert::From<asyncgit::sync::remotes::push::ProgressNotification>>::from
             at asyncgit/src/remote_progress.rs:134:18
  ...

Copy link
Collaborator

@extrawurst extrawurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still crashing, see above

@zcorniere
Copy link
Contributor Author

Sorry, it worked on my end. Thanks for the log, I'm on it !

@zcorniere
Copy link
Contributor Author

I'm not able to reproduce this behaviour, apologies :(

@extrawurst
Copy link
Collaborator

@zcorniere ok I fixed that for you on master: 62ea1de

@extrawurst extrawurst merged commit 56502ad into gitui-org:master Aug 15, 2021
@extrawurst
Copy link
Collaborator

@zcorniere thanks for you time and effort ❤️

@extrawurst
Copy link
Collaborator

extrawurst commented Aug 15, 2021

I'm not able to reproduce this behaviour, apologies :(

it was a classic divide by zero because apparently libgit sends us a progress update of 0 progress of 0 total :D

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 this pull request may close these issues.

support deleting remote branch
2 participants