File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ uriencode() {
1717 done
1818}
1919
20+ trim () {
21+ echo " $1 " | sed -E ' s/^[ \t]+|[ \t]+$//g'
22+ }
23+
2024git_get_remote () {
2125 remote=$( git remote -v | grep " (push)" | awk ' {print $2}' )
2226 echo $remote
@@ -214,8 +218,8 @@ git_open_new_pr() {
214218 default_branch=" master"
215219 fi
216220
217- branch=$( uriencode $branch )
218- default_branch=$( uriencode $default_branch )
221+ branch=" $( uriencode $( trim $ branch) ) "
222+ default_branch=" $( uriencode $( trim $ default_branch) ) "
219223
220224 case " $remote_type " in
221225 github) open_url " $silent " " https://github.com/$repo_path /compare/$default_branch ...$branch " ;;
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ describe "git_open_new_pr"
7979assert_value " https://github.com/chenasraf/git-open/compare/develop...master" $( git_open_new_pr -f master develop)
8080assert_value " https://github.com/chenasraf/git-open/compare/master...develop" $( git_open_new_pr -f develop)
8181assert_value " https://github.com/chenasraf/git-open/compare/master...$current_branch " $( git_open_new_pr -f)
82+ assert_value " https://github.com/chenasraf/git-open/compare/develop...master" $( git_open_new_pr -f " master " " develop " )
8283
8384describe " git_open_pipelines"
8485assert_value " https://github.com/chenasraf/git-open/actions" $( git_open_pipelines)
You can’t perform that action at this time.
0 commit comments