gerrit-seed 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: 92b8f30d835cb2010f4e98d6ed2834bf886b8066848ee1d153475e0035f11158
4
- data.tar.gz: ed7fcc4048c58ba43f714c3f4361534c7860adfc5a9d3f9161f313b1f83c13b4
3
+ metadata.gz: b6edec426de3cfdd0c58dd81dad495d827fc047b24f3c93b1f7fa5dbb12038d0
4
+ data.tar.gz: d05c0008a638b1d78c375c8d7a611cfcd6bde431050f46631619e2905e75feb8
5
5
  SHA512:
6
- metadata.gz: 011da5e9cae315ab188e1f62b6604b843880084a2b0ac6e2c34d1027fa1a8f2847db73c7608ce3ac7c9afb7384b61c69fef37b7e3e061fc0e7b9111020f4fb17
7
- data.tar.gz: 2b08d98c7ac478559a7d207484ace3abaf44ad665f520dfa110ea5fa07d4e0765a2ce46cf3521c39959188b3dd8937e6255bc33fc6a404d7ec29046d3e064fdb
6
+ metadata.gz: f9ff8e38105a0adb82db32defe855c9e325e0d8380427f1c2c6335ea78e29b40779a8998e82b6452e9ef7b4671b24ae167f49c415aefba73021e88071f10ae84
7
+ data.tar.gz: 50c6064a3dafe23f6c3f9f50caab717b501e2ebbf74885eecd1fa7d0bec6711800da12ba4cc57e195943b16db450ad7bcbc1823103bc383c9541c3c5536bed60
@@ -97,8 +97,18 @@ module GerritSeed
97
97
  commit: parent_branch_name,
98
98
  )
99
99
 
100
- git.shell.("touch #{branch_name}.in")
101
- git.shell.("git add #{branch_name}.in")
100
+ if change[:files]
101
+ change[:files].map do |file| File.expand_path(file, git.dir) end.each do |file|
102
+ FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(File.dirname(file))
103
+ FileUtils.touch(file)
104
+ end
105
+
106
+ git.shell.("git add .")
107
+ else
108
+ git.shell.("touch #{branch_name}.in")
109
+ git.shell.("git add #{branch_name}.in")
110
+ end
111
+
102
112
  git.commit(
103
113
  author: author[:full_name],
104
114
  email: author[:email],
@@ -43,8 +43,10 @@ module GerritSeed
43
43
  def checkout(branch:, commit:)
44
44
  if available_branches.include?(branch)
45
45
  shell.('git', 'checkout', branch)
46
+ shell.('git clean -f -d')
46
47
  else
47
48
  shell.('git', 'checkout', '-b', branch, commit)
49
+ shell.('git clean -f -d')
48
50
  end
49
51
  end
50
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gerrit-seed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmad Amireh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-14 00:00:00.000000000 Z
11
+ date: 2019-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json