2018-08-18 11:19:57 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-11-18 16:00:38 +00:00
|
|
|
module GitHelper
|
2019-11-25 12:06:13 +00:00
|
|
|
def strip_signature(text)
|
2019-12-09 00:07:44 +00:00
|
|
|
text = text.gsub(/-----BEGIN PGP SIGNATURE-----(.*)-----END PGP SIGNATURE-----/m, "")
|
|
|
|
text = text.gsub(/-----BEGIN PGP MESSAGE-----(.*)-----END PGP MESSAGE-----/m, "")
|
|
|
|
text = text.gsub(/-----BEGIN SIGNED MESSAGE-----(.*)-----END SIGNED MESSAGE-----/m, "")
|
|
|
|
text
|
2014-11-18 16:00:38 +00:00
|
|
|
end
|
2016-09-01 12:23:39 +00:00
|
|
|
|
|
|
|
def short_sha(text)
|
2016-09-06 17:08:06 +00:00
|
|
|
Commit.truncate_sha(text)
|
2016-09-01 12:23:39 +00:00
|
|
|
end
|
2014-11-18 16:00:38 +00:00
|
|
|
end
|