summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-29 17:41:26 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-29 17:41:26 +0900
commit5e81127c1bb810734a410b3f5905e01ab6b37b3c (patch)
tree327a6d94fe04ba8b5b4282731bfab145451f6f10 /tool
parent901b6d9c5025a30b3d7a5ed0a2c00baf9cfb061d (diff)
Fixed broken -a option behavior
Diffstat (limited to 'tool')
-rwxr-xr-xtool/sync_default_gems.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 1959b334aa..5bdede34a9 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -522,7 +522,7 @@ module SyncDefaultGems
# nil: failed
#++
- def resolve_conflicts(gem, sha)
+ def resolve_conflicts(gem, sha, edit)
# Forcibly remove any files that we don't want to copy to this repository.
# We also ignore them as new `toplevels` even when they don't conflict.
ignored_paths = []
@@ -576,6 +576,7 @@ module SyncDefaultGems
# AA: unmerged, both added
unmerged = changes.map {|line| line[/\A(?:.U|[UA]A) (.*)/, 1]}
unmerged.compact!
+ ignore_file_pattern = ignore_file_pattern_for(gem)
ignore, conflict = unmerged.partition {|name| ignore_file_pattern =~ name}
# Reset ignored files if they conflict
unless ignore.empty?
@@ -636,7 +637,7 @@ module SyncDefaultGems
end
end
- def pickup_commit(gem, sha)
+ def pickup_commit(gem, sha, edit)
# Attempt to cherry-pick a commit
result = IO.popen(%W"git cherry-pick #{sha}", &:read)
if result =~ /nothing\ to\ commit/
@@ -651,7 +652,7 @@ module SyncDefaultGems
end
# Skip the commit if it's empty or the cherry-pick attempt failed
- if /^CONFLICT/ =~ result and !resolve_conflicts(gem, sha)
+ if /^CONFLICT/ =~ result and !resolve_conflicts(gem, sha, edit)
`git reset` && `git checkout .` && `git clean -fd`
return nil
end
@@ -715,7 +716,7 @@ module SyncDefaultGems
]
commits.each do |sha, subject|
puts "Pick #{sha} from #{repo}."
- case pickup_commit(gem, sha)
+ case pickup_commit(gem, sha, edit)
when false
next
when nil