diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-14 16:58:16 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-14 16:58:28 +0300 |
commit | 076494646d30cefd396e0d6a0ae879a31aecb454 (patch) | |
tree | 121ba2380ffd01bcca27af6040faf7a5bb8842bf /lib/gitlab/key_fingerprint.rb | |
parent | 1221bec56ca7d3bf1ba3b09e7a283ff5c11449f2 (diff) |
Simplify regex.
Diffstat (limited to 'lib/gitlab/key_fingerprint.rb')
-rw-r--r-- | lib/gitlab/key_fingerprint.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/key_fingerprint.rb b/lib/gitlab/key_fingerprint.rb index 550b10a4c94..baf52ff750d 100644 --- a/lib/gitlab/key_fingerprint.rb +++ b/lib/gitlab/key_fingerprint.rb @@ -27,10 +27,10 @@ module Gitlab return nil unless cmd_status.zero? # 16 hex bytes separated by ':', optionally starting with "MD5:" - fingerprint_match = cmd_output.match(/(MD5:)?(?<fingerprint>(?:\h{2}:){15}\h{2})/) - return nil unless fingerprint_match + fingerprint_matches = cmd_output.match(/(MD5:)?(?<fingerprint>(\h{2}:){15}\h{2})/) + return nil unless fingerprint_matches - fingerprint_match[:fingerprint] + fingerprint_matches[:fingerprint] end private |