git-up 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/git-up.rb +13 -3
  2. data/lib/git-up/version.rb +1 -1
  3. metadata +8 -8
data/lib/git-up.rb CHANGED
@@ -100,9 +100,6 @@ class GitUp
100
100
  def with_stash
101
101
  stashed = false
102
102
 
103
- status = repo.status
104
- change_count = status.added.length + status.changed.length + status.deleted.length
105
-
106
103
  if change_count > 0
107
104
  puts "stashing #{change_count} changes".magenta
108
105
  repo.git.stash
@@ -244,6 +241,19 @@ EOS
244
241
  end
245
242
  end
246
243
 
244
+ def change_count
245
+ @change_count ||= begin
246
+ diff_status = repo.status
247
+ actual_status = repo.git.status(:porcelain => true).split("\n").map {|l| l[3..-1]}
248
+
249
+ added = diff_status.added.select { |(x,y)| actual_status.include? x }
250
+ changed = diff_status.changed.select { |(x,y)| actual_status.include? x }
251
+ deleted = diff_status.deleted.select { |(x,y)| actual_status.include? x }
252
+
253
+ added.length + changed.length + deleted.length
254
+ end
255
+ end
256
+
247
257
  def config(key)
248
258
  repo.config["git-up.#{key}"]
249
259
  end
@@ -1,3 +1,3 @@
1
1
  class GitUp
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-04-24 00:00:00.000000000 Z
15
+ date: 2012-05-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: thoughtbot-shoulda
19
- requirement: &70134838021440 !ruby/object:Gem::Requirement
19
+ requirement: &70332208938180 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: '0'
25
25
  type: :development
26
26
  prerelease: false
27
- version_requirements: *70134838021440
27
+ version_requirements: *70332208938180
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: colored
30
- requirement: &70134838020640 !ruby/object:Gem::Requirement
30
+ requirement: &70332208937240 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: '1.2'
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *70134838020640
38
+ version_requirements: *70332208937240
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: grit
41
- requirement: &70134838019620 !ruby/object:Gem::Requirement
41
+ requirement: &70332208936000 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>='
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0'
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *70134838019620
49
+ version_requirements: *70332208936000
50
50
  description:
51
51
  email:
52
52
  - aanand.prasad@gmail.com