git-utils 0.6.3 → 0.6.4
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-utils/command.rb +0 -2
- data/lib/git-utils/sync.rb +2 -5
- data/lib/git-utils/version.rb +1 -1
- data/spec/commands/sync_spec.rb +6 -0
- 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: 26672368e31366a1a0346024f6c63c6e311fa4bc
|
4
|
+
data.tar.gz: f508261f8d9caa3501b957dee630578442d594d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2750cea08cf0b2cfb8cd5f8ae546b8e30aff8ae5b927caf85607450d71e23710b799077e550faa61850d6f6afc462804e3535503e5bfdfe335a449d3c6b9417
|
7
|
+
data.tar.gz: 4b8ffc2a46c52d6fd4d249e0846f7f8ddd4a535394f853d3568104179e14183a684b701a3fb6136e76ecef2210e6a3f8b876d6eeefaec39855b23685db7f0c55
|
data/lib/git-utils/command.rb
CHANGED
data/lib/git-utils/sync.rb
CHANGED
@@ -4,10 +4,7 @@ class Sync < Command
|
|
4
4
|
|
5
5
|
def parser
|
6
6
|
OptionParser.new do |opts|
|
7
|
-
opts.banner = "Usage: git sync"
|
8
|
-
opts.on("-b", "--branch", "sync with given branch") do |opt|
|
9
|
-
self.options.branch = opt
|
10
|
-
end
|
7
|
+
opts.banner = "Usage: git sync [branch]"
|
11
8
|
opts.on_tail("-h", "--help", "this usage guide") do
|
12
9
|
puts opts.to_s; exit 0
|
13
10
|
end
|
@@ -16,7 +13,7 @@ class Sync < Command
|
|
16
13
|
|
17
14
|
# Returns a command appropriate for executing at the command line.
|
18
15
|
def cmd
|
19
|
-
branch =
|
16
|
+
branch = self.known_options.first || 'master'
|
20
17
|
c = ["git checkout #{branch}"]
|
21
18
|
c << "git pull"
|
22
19
|
c << "git checkout #{current_branch}"
|
data/lib/git-utils/version.rb
CHANGED
data/spec/commands/sync_spec.rb
CHANGED
@@ -12,6 +12,12 @@ describe Sync do
|
|
12
12
|
its(:cmd) { should match /git pull/ }
|
13
13
|
its(:cmd) { should match /git checkout #{command.current_branch}/ }
|
14
14
|
|
15
|
+
describe "description" do
|
16
|
+
let(:alternate_branch) { 'alternate' }
|
17
|
+
before { command.stub(:known_options).and_return([alternate_branch]) }
|
18
|
+
its(:cmd) { should match /git checkout #{alternate_branch}/ }
|
19
|
+
end
|
20
|
+
|
15
21
|
describe "command-line command" do
|
16
22
|
subject { `bin/git-sync --debug` }
|
17
23
|
it { should match /git checkout master/ }
|