Permalink
Browse files

git get is-head-detached

  • Loading branch information...
1 parent a5aae10 commit 9b0c67a9124c0a24ef347e4715a20904034e2401 @mjdominus committed Apr 18, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 git-get
View
@@ -18,6 +18,14 @@ sub current_branch_name {
_run("git rev-parse --symbolic-full-name --abbrev-ref HEAD");
}
+sub is_head_detached {
+ exit (_head_detached() ? 0 : 1);
+}
+
+sub _head_detached {
+ system("git symbolic-ref -q HEAD > /dev/null") != 0;
+}
+
sub branch_remote {
my ($branch) = @_;
$branch ||= current_branch_name();

0 comments on commit 9b0c67a

Please sign in to comment.