123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- if __FILE__ == $0
-
- branch = 'prod'
- exit(0) if ARGV[0] !~ /#{branch}/
- commit_id = ARGV[1]
- %x[/usr/bin/git checkout #{branch}]
- %x[/usr/bin/git merge #{commit_id}]
- count = 0
-
- lines = %x[/usr/bin/git rev-list --left-right remotes/origin/stg...#{branch}].split("\n")
- lines.each do |commit|
-
- next if commit =~ /^</
-
- commit = commit[1..-1]
-
- results = %x[/usr/bin/git branch -q -r --contains #{commit} 2>/dev/null ]
-
-
- next if results.empty?
-
-
-
-
-
- unless results =~ /origin\/stg/
- puts "\nFAILED: (These commits are not in stage.)\n"
- puts "\t#{commit}"
- count += 1
- end
- end
-
- exit(count)
- end
|