Skip to content
Snippets Groups Projects
Commit 07649464 authored by Douwe Maan's avatar Douwe Maan
Browse files

Simplify regex.

parent 1221bec5
No related branches found
No related tags found
No related merge requests found
Loading
@@ -27,10 +27,10 @@ module Gitlab
Loading
@@ -27,10 +27,10 @@ module Gitlab
return nil unless cmd_status.zero? return nil unless cmd_status.zero?
   
# 16 hex bytes separated by ':', optionally starting with "MD5:" # 16 hex bytes separated by ':', optionally starting with "MD5:"
fingerprint_match = cmd_output.match(/(MD5:)?(?<fingerprint>(?:\h{2}:){15}\h{2})/) fingerprint_matches = cmd_output.match(/(MD5:)?(?<fingerprint>(\h{2}:){15}\h{2})/)
return nil unless fingerprint_match return nil unless fingerprint_matches
   
fingerprint_match[:fingerprint] fingerprint_matches[:fingerprint]
end end
   
private private
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment