Permalink
Browse files

git-get is-remote exits 0 iff argument names a remote

  • Loading branch information...
1 parent 70f9125 commit 09cec6a27b9d3aaa23a4c8067b2c5807b8b5858d @mjdominus committed Mar 25, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 git-get
View
@@ -52,6 +52,12 @@ sub heads {
@heads;
}
+sub is_remote {
+ my ($in) = @_;
+ $in .= "\n";
+ if (grep $_ eq $in, qx{git remote}) { exit 0 } else { exit 1 }
+}
+
sub _run {
my @cmd = @_;
open my($p), "-|", @cmd or die "Couldn't run '@cmd': $!";

0 comments on commit 09cec6a

Please sign in to comment.