git_topic 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git_topic/commands/list.rb +3 -3
- data/lib/git_topic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f3d85fef204acd26355f44a35b949dbe17cbded
|
|
4
|
+
data.tar.gz: cc248c05202b90fa063e267c0109d22bbd51ed45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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,
|
|
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
|
data/lib/git_topic/version.rb
CHANGED