defunkt-github 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. data/commands/commands.rb +11 -0
  2. metadata +1 -1
data/commands/commands.rb CHANGED
@@ -61,6 +61,17 @@ command :track do |remote, user|
61
61
  end
62
62
  end
63
63
 
64
+ desc "Fetch from a remote to a local branch."
65
+ command :fetch do |user, branch|
66
+ die "Specify a user to pull from" if user.nil?
67
+ user, branch = user.split("/", 2) if branch.nil?
68
+ branch ||= 'master'
69
+ GitHub.invoke(:track, user) unless helper.tracking?(user)
70
+
71
+ git "fetch #{user} #{branch}:refs/remotes/#{user}/#{branch}"
72
+ git_exec "checkout -b #{user}/#{branch} refs/remotes/#{user}/#{branch}"
73
+ end
74
+
64
75
  desc "Pull from a remote."
65
76
  flags :merge => "Automatically merge remote's changes into your master."
66
77
  command :pull do |user, branch|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defunkt-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath, Kevin Ballard