git-branch-delete-orphans 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ ['TERM', 'INT'].each do |signal|
4
+ Signal.trap(signal) do
5
+ # most likely, users will CTRL-C when being prompted
6
+ # for an action, so we need to ensure that the shell
7
+ # prompt is rendered on a new line
8
+ puts
9
+ exit -1
10
+ end
11
+ end
12
+
3
13
  def remotes
4
14
  puts "Listing remote branches..."
5
15
  @remote ||= `git ls-remote | grep 'refs/heads'`.split("\n").map { |l| l.gsub(/^.*refs\/heads\//, '').strip }
@@ -27,7 +37,8 @@ def cli(orphans)
27
37
  keep = false
28
38
  until delete || delete_all || keep || keep_all
29
39
  puts ""
30
- puts "#{b} tracks a remote branch which does not exist anymore. Do you want to [d]elete it, [D]elete all, [k]eep it or [K]eep all?"
40
+ puts "#{b} tracks a remote branch which does not exist anymore."
41
+ print "Do you want to [d]elete it, [D]elete all, [k]eep it or [K]eep all? "
31
42
  case STDIN.gets.chomp
32
43
  when 'd' then delete = true
33
44
  when 'D' then delete_all = true
@@ -2,7 +2,7 @@ module Git
2
2
  module Branch
3
3
  module Delete
4
4
  module Orphans
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-branch-delete-orphans
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-04 00:00:00.000000000 Z
12
+ date: 2012-07-12 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! '`git branch-delete-orphans` lists orphan tracking branches and prompts
15
15
  you to delete or keep them.'