config/git: fix newline issue in git-get
This commit is contained in:
parent
2b44f0eb08
commit
6eb61dc70b
|
@ -4,5 +4,5 @@ set -e
|
||||||
remote=$(git-repo "$@")
|
remote=$(git-repo "$@")
|
||||||
echo "Cloning $remote"
|
echo "Cloning $remote"
|
||||||
git clone $remote ${@:4} --recurse-submodules
|
git clone $remote ${@:4} --recurse-submodules
|
||||||
cd "$(expr "$2" || basename ${remote%.git})"
|
cd "$(test -n "$2" && echo "$2" || basename ${remote%.git})"
|
||||||
exec "$SHELL"
|
exec "$SHELL"
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Translates different repo notations into ssh
|
# Translate different repo notations into ssh
|
||||||
|
# Usage:
|
||||||
|
# git repo <url>
|
||||||
|
# git repo <host> <repo> [user]
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(http*) echo $1 | sed "s|.*//\([^/]*\)/\(.*\)|git@\1:\2.git|";;
|
(http*) echo "$1" | sed "s|.*//\([^/]*\)/\(.*\)|git@\1:\2.git|" ;;
|
||||||
(git:*) echo "$1" ;;
|
(git:*) echo "$1" ;;
|
||||||
(*) echo "${1:-git.jfischer.org}:${3:-$(git config user.name)}/${2:-$(basename $PWD)}.git" ;;
|
(*) echo "${1:-git.jfischer.org}:${3:-$(git config user.name)}/${2:-$(basename $PWD)}.git" ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue