Repository navigation
prCreate() now deletes a newly-created repository if it encounters an error. - #615
angus-lherrou wants to merge 2 commits into
Conversation
Added function ExistsRemote() in git.go to check if a branch exists at a remote. Added a test to git_test.go to test this function on a sample repo. Modified pr_create_test.go to account for different command executions.
|
Never mind, I just didn't understand what GoLand was telling me. This commit should fix it. |
There was a problem hiding this comment.
Hi thank you for the fix!
This looks like a lot of code changes and I'm reluctant to merge this due to the overall diff size. It also feels like the approach is complex: it adds new routines to delete information pushed to GitHub if any error was encountered.
As an alternative approach to this, in #618 I'm exploring how to avoid forking/pushing in the first place. That way we avoid having to potentially do cleanup (deleting repos/branches) on errors. Let me know what you think
|
Hey @mislav -- The diff does look large but much of the actual change to existing code is only to wrap a bunch of the existing code in the function in a for loop that I break out of instead of returning when there's an error. The diff looks large because all the existing lines are indented. I think your idea of changing it to avoid forking/pushing until the end makes more sense, though. |
Added function ExistsRemote() in git.go to check if a branch exists at a remote.
Added a test to git_test.go to test this function on a sample repo.
Modified pr_create_test.go to account for different command executions.
Fixes #482