Skip to content
New issue

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

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

Already on GitHub? # to your account

pr_finish(n) dies in pr_fetch() if remote branch already deleted #1196

Closed
jennybc opened this issue Jul 30, 2020 · 1 comment
Closed

pr_finish(n) dies in pr_fetch() if remote branch already deleted #1196

jennybc opened this issue Jul 30, 2020 · 1 comment
Labels
git git, GitHub, and CI in general

Comments

@jennybc
Copy link
Member

jennybc commented Jul 30, 2020

 Checking out PR 'r-lib/gh/#121' (@jennybc): 'Accept (and prioritize) URI templates (a la RFC 6570)'
✓ Switching to branch 'curly-bracket-uri-template'
✓ Setting 'origin/curly-bracket-uri-template' as remote tracking branch
Error in libgit2::git_branch_set_upstream : 
  cannot set upstream for branch 'curly-bracket-uri-template'

As a result, we never get to all the cleanup code, e.g. deleting the local branch.

Current workaround: just call pr_finish() (no argument!) again.

@jennybc jennybc added the git git, GitHub, and CI in general label Jul 30, 2020
@jennybc
Copy link
Member Author

jennybc commented Sep 29, 2020

I don't see an easy fix, i.e. it suggests some nontrivial refactoring where we proactively identify the PR situation. Relevant facts:

  • Is the PR internal to the source repo or is it external (coming from a fork)?
  • Current user's role/permission, e.g. internal or external contributor
  • Whether the PR has ever been checked out locally before

Instead of having one logical flow that handles all scenarios, it might be easier to characterize the situation and use logic specific to that scenario. This comment is nominally about pr_finish() but may also apply to pr_fetch().

@jennybc jennybc added this to the v2.0.0 milestone Oct 28, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
git git, GitHub, and CI in general
Projects
None yet
Development

No branches or pull requests

1 participant