diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-02-05 21:42:31 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-02-05 21:42:31 +0100 |
commit | 68cf024bfcff59b9a812cfcc53e3520a28c14ead (patch) | |
tree | bf7474e3eb01f4bf457dfa1b437238b21d03cb50 /bin/gittool.php | |
parent | c39ae2c9fac32286855eae27a5caeffb15f2621d (diff) | |
download | rpg-68cf024bfcff59b9a812cfcc53e3520a28c14ead.tar.gz rpg-68cf024bfcff59b9a812cfcc53e3520a28c14ead.tar.bz2 |
check for empty repo
Diffstat (limited to 'bin/gittool.php')
-rwxr-xr-x | bin/gittool.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/gittool.php b/bin/gittool.php index 26aa1cc0e..23e8552b4 100755 --- a/bin/gittool.php +++ b/bin/gittool.php @@ -276,15 +276,18 @@ EOF; if(!$ext) die("extension plugin not available, can't continue"); $ext->setExtension($extension); + $repourl = $ext->getSourcerepoURL(); + if(!$repourl) return false; + // match github repos - if(preg_match('/github\.com\/([^\/]+)\/([^\/]+)/i', $ext->getSourcerepoURL(), $m)) { + if(preg_match('/github\.com\/([^\/]+)\/([^\/]+)/i', $repourl, $m)) { $user = $m[1]; $repo = $m[2]; return 'https://github.com/'.$user.'/'.$repo.'.git'; } // match gitorious repos - if(preg_match('/gitorious.org\/([^\/]+)\/([^\/]+)?/i', $ext->getSourcerepoURL(), $m)) { + if(preg_match('/gitorious.org\/([^\/]+)\/([^\/]+)?/i', $repourl, $m)) { $user = $m[1]; $repo = $m[2]; if(!$repo) $repo = $user; @@ -293,7 +296,7 @@ EOF; } // match bitbucket repos - most people seem to use mercurial there though - if(preg_match('/bitbucket\.org\/([^\/]+)\/([^\/]+)/i', $ext->getSourcerepoURL(), $m)) { + if(preg_match('/bitbucket\.org\/([^\/]+)\/([^\/]+)/i', $repourl, $m)) { $user = $m[1]; $repo = $m[2]; return 'https://bitbucket.org/'.$user.'/'.$repo.'.git'; |