Permalink
Browse files

git-get heads lists local heads

  • Loading branch information...
1 parent 7d442e9 commit 70f91256c6eb5df1a5609610c6aaa026042d2314 @mjdominus committed Mar 25, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 git-get
View
10 git-get
@@ -42,6 +42,16 @@ sub working_tree_dirty {
return 0;
}
+sub heads {
+ my @heads;
+ for (qx{git branch}) {
+ s/^..//; # Trim off leading '*' and/or spaces
+ push @heads, $_;
+ }
+ chomp $heads[-1]; # wrapper will append an extra newline on output
+ @heads;
+}
+
sub _run {
my @cmd = @_;
open my($p), "-|", @cmd or die "Couldn't run '@cmd': $!";

0 comments on commit 70f9125

Please sign in to comment.