Module: GitHelper

Included in:
MergeRequestDiffEntity
Defined in:
app/helpers/git_helper.rb

Instance Method Summary collapse

Instance Method Details

#short_sha(text) ⇒ Object


11
12
13
# File 'app/helpers/git_helper.rb', line 11

def short_sha(text)
  Commit.truncate_sha(text)
end

#strip_signature(text) ⇒ Object


4
5
6
7
8
9
# File 'app/helpers/git_helper.rb', line 4

def strip_signature(text)
  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
end