Skip to content

Instantly share code, notes, and snippets.

@dann
Created August 31, 2009 14:19
Show Gist options
  • Select an option

  • Save dann/178484 to your computer and use it in GitHub Desktop.

Select an option

Save dann/178484 to your computer and use it in GitHub Desktop.
--- Git.pm>.....2009-08-31 23:11:07.000000000 +0900
+++ Git.pm.orig>2009-08-31 23:04:51.000000000 +0900
@@ -61,25 +61,6 @@
print $tmp_fh $msg;
my $tmp_fn = "$tmp_fh";
system($command, "commit", "-a", "-F", $tmp_fn);
-
- if (my $where = $self->{push_to}) {
- my $branch = $self->_get_branch;
- if ($branch) {
- warn "pushing to $where";
- system($self->command, "push", $where, $branch);
- }
- }
-}
-
-sub _get_branch {
- my $self = shift;
-
- open my $fh, '<', '.git/HEAD';
- chomp(my $head = do { local $/; <$fh> });
- close $fh;
-
- my ($branch) = $head =~ m!ref: refs/heads/(\S+)!;
- return $branch;
}
sub local_diff {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment