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() {
17
17
done
18
18
}
19
19
20
+ trim () {
21
+ echo " $1 " | sed -E ' s/^[ \t]+|[ \t]+$//g'
22
+ }
23
+
20
24
git_get_remote () {
21
25
remote=$( git remote -v | grep " (push)" | awk ' {print $2}' )
22
26
echo $remote
@@ -214,8 +218,8 @@ git_open_new_pr() {
214
218
default_branch=" master"
215
219
fi
216
220
217
- branch=$( uriencode $branch )
218
- default_branch=$( uriencode $default_branch )
221
+ branch=" $( uriencode $( trim $ branch) ) "
222
+ default_branch=" $( uriencode $( trim $ default_branch) ) "
219
223
220
224
case " $remote_type " in
221
225
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"
79
79
assert_value " https://github.com/chenasraf/git-open/compare/develop...master" $( git_open_new_pr -f master develop)
80
80
assert_value " https://github.com/chenasraf/git-open/compare/master...develop" $( git_open_new_pr -f develop)
81
81
assert_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 " )
82
83
83
84
describe " git_open_pipelines"
84
85
assert_value " https://github.com/chenasraf/git-open/actions" $( git_open_pipelines)
You can’t perform that action at this time.
0 commit comments