git_topic 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8f1c24c1b4142264dc07264c30a643eaaa77143
4
- data.tar.gz: 3ae34a090719fbabd42fa3b4627f1f0660fc34e7
3
+ metadata.gz: 8f3d85fef204acd26355f44a35b949dbe17cbded
4
+ data.tar.gz: cc248c05202b90fa063e267c0109d22bbd51ed45
5
5
  SHA512:
6
- metadata.gz: 1dc2315a42e587f02d70962282c431413c1fdc42327f8635bd93f9a9dfde77cc9f4b243837cee669125d7a0bbcbe9ac555a115bfb9e39d0f943afdfe2364d893
7
- data.tar.gz: 59e5adeb6b5cee7fa5eb49d4db88f6d9594e6bffbdabf94d51e164f4ab6a3c67d96331ef49ecff022b922e782b986017080d06144160bff20f826d251298e328
6
+ metadata.gz: 35eb5492032c09f06f2276076d45eedf981659b18314f9c718663acd2c4f62944fd9c00443011c57ea132971821cb5851664d50560dcb4819033f2c048c82095
7
+ data.tar.gz: 73e0921f72236f3cc7e74696e5da750bb27b6e953c19358c84b7fa1515a86b2de3cef6cdbbd27df6bb8c936bad47afd7c0906aede70489c7419600ffb0a30e50
@@ -35,7 +35,8 @@ module GitTopic
35
35
  current_branch = nil
36
36
  _stdin, stdout, _stderr, _wait_thr = *Open3.popen3('git branch -v')
37
37
  stdout.each do |line|
38
- branch_name, rev, current_branch = parse_branch(line)
38
+ branch_name, rev, current_candidate = parse_branch(line)
39
+ current_branch ||= current_candidate
39
40
  branches << Branch.new(branch_name, rev)
40
41
  end
41
42
  [branches, current_branch]
@@ -45,8 +46,7 @@ module GitTopic
45
46
  matched = line.match(/\s*(\* )?(\S+)\s+(\S+)\s+(.*)/)
46
47
  raise 'cannot parse branch' unless matched
47
48
  branch_name = matched[2]
48
- current_branch = nil
49
- current_branch = branch_name if matched[1]
49
+ current_branch = matched[1] ? branch_name : nil
50
50
  rev = matched[3]
51
51
  [branch_name, rev, current_branch]
52
52
  end
@@ -1,3 +1,3 @@
1
1
  module GitTopic
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_topic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Kondo