mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Merge pull request #166 from glostis/fix-suffix
Fix suffix with `=` in it
This commit is contained in:
commit
3e8c908dcd
5
git-open
5
git-open
|
|
@ -46,7 +46,8 @@ done
|
|||
|
||||
# parse suffix from suffix=value
|
||||
IFS='=' read -ra suffix_flag <<< "$suffix_flag"
|
||||
suffix=${suffix_flag[1]}
|
||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||
suffix=$(join_by "=" "${suffix_flag[@]:1}")
|
||||
|
||||
# are we in a git repo?
|
||||
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||
|
|
@ -143,7 +144,7 @@ else
|
|||
# Resolve sshconfig aliases
|
||||
if [[ -e "$ssh_config" ]]; then
|
||||
domain_resolv=$(ssh_resolve "$domain")
|
||||
if [[ ! -z "$domain_resolv" ]]; then
|
||||
if [[ -n "$domain_resolv" ]]; then
|
||||
domain="$domain_resolv"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -172,6 +172,11 @@ setup() {
|
|||
assert_output "https://github.com/paulirish/git-open/anySuffix"
|
||||
}
|
||||
|
||||
@test "gh: git open --suffix anySuffix?hello=world" {
|
||||
run ../git-open "--suffix" "anySuffix?hello=world"
|
||||
assert_output "https://github.com/paulirish/git-open/anySuffix?hello=world"
|
||||
}
|
||||
|
||||
@test "gh: gist" {
|
||||
git remote set-url origin "git@gist.github.com:2d84a6db1b41b4020685.git"
|
||||
run ../git-open
|
||||
|
|
|
|||
Loading…
Reference in a new issue