ghpages_deploy 2.0.8 → 2.0.9

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: a550184e235d5771c8d844fa0d11548bc47c495a
4
- data.tar.gz: aa13aa90a2fd17bdda80a2ef5f3d6baca3387887
3
+ metadata.gz: 8e914f1c2435ac68771161842c26c9c49ec140d8
4
+ data.tar.gz: 9f965f6258b34a645a9647588c6803c6f42f9d04
5
5
  SHA512:
6
- metadata.gz: 67784f0442d6095b2b24562a22e4906a63c2c435ad10fd2484c684b58ff70fb06e9bef529a409d14be3e227ce8e9c37cce03a6c384d42f61d9406c2636dfdd84
7
- data.tar.gz: f0942c03ff23e2caa45e7d19bb6587f7b7e2047e666fb3f0cb6f005cd089a53001e91fc9fc05be1f67348041b1fa418fe2c92f85172c6d296bcb9320314ff03b
6
+ metadata.gz: c52e079c6adbace9f68d05657f900c99208fb5925c9dc1e7d367be9d4b83607cda8247d2d5fc02804a6d1b0ba9626702005e9af793252d629cf05d11d97b2bf4
7
+ data.tar.gz: 4e78feb6b57a0a45c28c7194cb0aeffab56ec1c454bbef1d6c96cbd45d7d9330759b9154bed0638b974e2dc8ed0bb8f343cab8ca1225828d4a85594c3b6bf91e
@@ -49,7 +49,7 @@ module GithubPages
49
49
 
50
50
  def commit_and_push(msg)
51
51
  @git.commit(msg)
52
- @git.push(remote, "HEAD:#{branch}")
52
+ @git.push(remote, "ghpages_deployment:#{branch}")
53
53
  end
54
54
 
55
55
  def remove(*files)
@@ -78,7 +78,8 @@ module GithubPages
78
78
  end
79
79
 
80
80
  def setup_repo
81
- @git.add_remote(remote, repo) unless @git.remotes.map(&:name).include?(remote)
81
+ @git.remove_remote(remote) if @git.remotes.map(&:name).include?(remote)
82
+ @git.add_remote(remote, repo)
82
83
  @git.remote(remote).fetch
83
84
  end
84
85
 
@@ -93,19 +94,21 @@ module GithubPages
93
94
  git "clean -d -x -f -e #{@preserved}"
94
95
  end
95
96
 
96
- def remote_branch
97
- @git.branches.remote.find do |br|
97
+ def remote_branch?
98
+ @git.branches.remote.any? do |br|
98
99
  br.name == branch && br.remote == remote
99
100
  end
100
101
  end
101
102
 
102
103
  def setup_branch
103
- if br = remote_branch
104
- br.checkout
104
+ if remote_branch?
105
+ puts 'checking out remote branch'
106
+ git "checkout -b ghpages_deployment #{remote}/#{branch}"
105
107
  remove_staged
106
108
  @git.pull(remote, branch)
107
109
  else
108
- git "checkout --orphan #{remote}/#{branch}"
110
+ puts 'checking out orphan branch'
111
+ git "checkout --orphan ghpages_deployment"
109
112
  remove_staged
110
113
  end
111
114
  end
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2016 Nathan Currier
3
3
 
4
4
  module GithubPages
5
- VERSION = '2.0.8'.freeze
5
+ VERSION = '2.0.9'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghpages_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Currier