mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Only run gerrit plugin for repos on gerrit
This commit is contained in:
parent
9e58a8f9e9
commit
564efc560c
1 changed files with 6 additions and 1 deletions
|
|
@ -89,6 +89,12 @@ function gerrit_setup () {
|
||||||
|
|
||||||
function gerrit () {
|
function gerrit () {
|
||||||
|
|
||||||
|
gitRemoteUrl=`git config --get remote.origin.url`;
|
||||||
|
if [[ $gitRemoteUrl != *"gerrit"* ]]; then
|
||||||
|
echo "This repository isn't on Gerrit Host.";
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null);
|
ref=$(git symbolic-ref HEAD 2> /dev/null);
|
||||||
branch=${ref#refs/heads/};
|
branch=${ref#refs/heads/};
|
||||||
|
|
||||||
|
|
@ -104,5 +110,4 @@ function gerrit () {
|
||||||
[ "$1" = "clone" ] && gerrit_clone "$2";
|
[ "$1" = "clone" ] && gerrit_clone "$2";
|
||||||
[ "$1" = "setup" ] && gerrit_setup;
|
[ "$1" = "setup" ] && gerrit_setup;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue