mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Merge pull request #115 from larsks/feature/ls-url
Use ls-remote --get-url to get remote url
This commit is contained in:
commit
7449bfa7e1
3
git-open
3
git-open
|
|
@ -49,8 +49,7 @@ remote=${1:-$default_remote}
|
|||
remote=${remote:-$tracked_remote}
|
||||
remote=${remote:-"origin"}
|
||||
|
||||
# @TODO ls-remote will also expand "insteadOf" items `giturl=$(git ls-remote --get-url $remote)``
|
||||
giturl=$(git config --get "remote.${remote}.url")
|
||||
giturl=$(git ls-remote --get-url "$remote")
|
||||
|
||||
if [[ -z "$giturl" ]]; then
|
||||
echo "Git remote is not set for $remote" 1>&2
|
||||
|
|
|
|||
|
|
@ -35,6 +35,18 @@ setup() {
|
|||
assert_output --partial "usage: git open"
|
||||
}
|
||||
|
||||
##
|
||||
## url handling
|
||||
##
|
||||
|
||||
@test "url: insteadOf handling" {
|
||||
git config --global url.http://example.com/.insteadOf ex:
|
||||
git remote set-url origin ex:example.git
|
||||
git checkout -B master
|
||||
run ../git-open
|
||||
assert_output "http://example.com/example"
|
||||
}
|
||||
|
||||
##
|
||||
## GitHub
|
||||
##
|
||||
|
|
|
|||
Loading…
Reference in a new issue