File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,14 @@ git_open_pr_list() {
183183}
184184
185185git_open_new_pr () {
186- existing=" $( git_find_pr $@ ) "
186+ if [[ " $1 " == " --force" || " $1 " == " -f" ]]; then
187+ shift
188+ existing=" "
189+ else
190+ existing=" $( git_find_pr $@ ) "
191+ fi
187192
188193 if [[ -n " $existing " ]]; then
189- echo " PR already exists: $existing "
190194 open_url " $silent " $existing
191195 return 0
192196 fi
@@ -240,7 +244,7 @@ git_find_pr() {
240244 commit=" $( git rev-parse $branch ) "
241245
242246 case " $remote_type " in
243- github) prrefs=" pulls /*/head" ; prfilt=" pulls " ;;
247+ github) prrefs=" pull /*/head" ; prfilt=" pull " ;;
244248 gitlab) prrefs=" merge-requests/*/head" ; prfilt=" merge-requests" ;;
245249 bitbucket) prrefs=" pull-requests/*/head" ; prfilt=" pull-requests" ;;
246250 esac
Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ describe "git_open_pr_list"
7676assert_value " https://github.com/chenasraf/git-open/pulls?q=is%3Apr+is%3Aopen" $( git_open_pr_list)
7777
7878describe " git_open_new_pr"
79- assert_value " https://github.com/chenasraf/git-open/compare/develop...master" $( git_open_new_pr master develop)
80- assert_value " https://github.com/chenasraf/git-open/compare/master...develop" $( git_open_new_pr develop)
81- assert_value " https://github.com/chenasraf/git-open/compare/master...$current_branch " $( git_open_new_pr)
79+ assert_value " https://github.com/chenasraf/git-open/compare/develop...master" $( git_open_new_pr -f master develop)
80+ assert_value " https://github.com/chenasraf/git-open/compare/master...develop" $( git_open_new_pr -f develop)
81+ assert_value " https://github.com/chenasraf/git-open/compare/master...$current_branch " $( git_open_new_pr -f )
8282
8383describe " git_open_pipelines"
8484assert_value " https://github.com/chenasraf/git-open/actions" $( git_open_pipelines)
You can’t perform that action at this time.
0 commit comments