Skip to content

Commit c5128ca

Browse files
committed
Rename --git-remote option to --remote
Attempt to get remote name from local git-config gitlab.remote option
1 parent c81123b commit c5128ca

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

git-gitlab.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ instance_name() {
2323
grep -B 5 "^\s*url\s*=\s*http\(s\)*://$host" ~/.python-gitlab.cfg | grep "^\[" | tail -n 1 | sed -e 's#\[\(.\+\)\]#\1#'
2424
}
2525

26-
if [ "x$1" = "x--git-remote" ]; then
26+
remote=$(git config --local gitlab.remote)
27+
[ -n "$remote" ] || remote=$(git remote)
28+
if [ "x$1" = "x--remote" ]; then
2729
remote=$2
2830
shift 2
2931
fi
30-
[ -n "$remote" ] || remote=$(git remote)
3132
if [ -z "$remote" ]; then
3233
echo "No remotes found in repository"
3334
exit 1
3435
fi
3536
if [ $(echo $remote | wc -w) -gt 1 ]; then
36-
echo "Multiple remotes found, specify a remote using --git-remote REMOTE"
37+
echo "Multiple remotes found, specify a remote using --remote REMOTE"
3738
exit 1
3839
fi
3940

git-glab-pipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# TODO:
44
# check args for cfg file
5-
if [ "x$1" = "x--git-remote" ]; then
5+
if [ "x$1" = "x--remote" ]; then
66
git_repo="$1 $2"
77
shift 2
88
fi

0 commit comments

Comments
 (0)