Skip to content
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

Fix deleting branches without upstream #706

Merged
merged 1 commit into from
Mar 25, 2018

Conversation

MontakOleg
Copy link

See #705 for details

@spacewander
Copy link
Collaborator

@MontakOleg
Maybe we could use git config branch.$branch.remote || echo 'origin' and git branch -D ... || continue to achieve the same result, without removing the set -e?

@MontakOleg
Copy link
Author

I will try

@MontakOleg
Copy link
Author

git branch -D ... || continue will skip deleting remote branch, if local branch does not exists. This is expected behavior?

And what we want to do if git branch -d -r $remote/$branch fails?

I would prefer to try delete remote branch even if there no local branch.

@spacewander
Copy link
Collaborator

@MontakOleg
Well, we could use git branch -D ... || true instead?
In my opinion, we could use || continue with git branch -d -r $remote/$branch. If we failed to delete the remote tracking branch locally, we don't need to push the change to the remote.

@MontakOleg MontakOleg changed the title Remove 'set -e' line to fix deleting branches without upstream Fix deleting branches without upstream Mar 24, 2018
@MontakOleg
Copy link
Author

@spacewander
Look at this, please.

@spacewander spacewander merged commit 1b94ca1 into tj:master Mar 25, 2018
@spacewander
Copy link
Collaborator

@MontakOleg
Merged. Thank you!

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.

2 participants