151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
# File 'lib/datadog/ci/git/local_repository.rb', line 151
def self.git_commit_users
output = exec_git_command("git show -s --format='%an\t%ae\t%at\t%cn\t%ce\t%ct'")
unless output
Datadog.logger.debug(
"Unable to read git commit users: git command output is nil"
)
nil_user = NilUser.new
return [nil_user, nil_user]
end
author_name, author_email, author_timestamp,
committer_name, committer_email, committer_timestamp = output.split("\t").each(&:strip!)
author = User.new(author_name, author_email, author_timestamp)
committer = User.new(committer_name, committer_email, committer_timestamp)
[author, committer]
rescue => e
log_failure(e, "git commit users")
nil_user = NilUser.new
[nil_user, nil_user]
end
|