Skip to content
Snippets Groups Projects
Commit 9d7ba8f8 authored by Sean Paul's avatar Sean Paul :speech_balloon: Committed by Simona Vetter
Browse files

dim: Ensure a branch doesn't exist before creating it


Check the remote for the branch before creating it. Seems like this is
a noop if it does exist, aside from creating duplicate entries in the
integration config.

Signed-off-by: Sean Paul's avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 14775d81
No related branches found
No related tags found
No related merge requests found
...@@ -1215,6 +1215,10 @@ function dim_create_branch ...@@ -1215,6 +1215,10 @@ function dim_create_branch
fi fi
remote=$(repo_to_remote $repo) remote=$(repo_to_remote $repo)
if [[ $(git branch -r | grep "$remote/$branch") ]]; then
echoerr "$branch already exists on $remote"
return 1
fi
$DRY git branch $branch $start $DRY git branch $branch $start
git push $DRY_RUN $remote +$branch --set-upstream git push $DRY_RUN $remote +$branch --set-upstream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment