summaryrefslogtreecommitdiff
path: root/tool/sync_default_gems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-xtool/sync_default_gems.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 83cac39a49..467063b968 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -583,6 +583,22 @@ module SyncDefaultGems
next
end
+ tools = pipe_readlines(%W"git diff --name-only -z HEAD~..HEAD -- test/lib/ tool/")
+ unless tools.empty?
+ system(*%W"git checkout HEAD~ --", *tools)
+ if system(*%W"git diff --quiet HEAD~")
+ `git reset HEAD~ --` && `git checkout .` && `git clean -fd`
+ puts "Skip commit #{sha} only for tools"
+ next
+ end
+ unless system(*%W"git commit --amend --no-edit --", *tools)
+ failed_commits << sha
+ `git reset HEAD~ --` && `git checkout .` && `git clean -fd`
+ puts "Failed to pick #{sha}"
+ next
+ end
+ end
+
head = `git log --format=%H -1 HEAD`.chomp
system(*%w"git reset --quiet HEAD~ --")
amend = replace_rdoc_ref_all