Commit 7848e6eb authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'tmslvnkc/wiki/fix' into 'master'

Fixing some minor regex error

See merge request gitlab-org/gitlab!33927
parents b168b70c f78fa4c9
......@@ -31,7 +31,9 @@ module QA
def web_url
# TODO
# workaround
repository_http_uri.to_s.gsub(".wiki.git", "/-/wikis/#{@file_name.gsub('.md', '')}")
# i.e. This replaces the last occurence of the string (case sensitive)
# and attaches everything before to the new substring
repository_http_uri.to_s.gsub(/(.*)\b\.wiki\.git\b/i, "\\1/-/wikis/#{@file_name.gsub('.md', '')}")
end
end
end
......
......@@ -58,7 +58,9 @@ module QA
def switching_to_wiki_url(url)
# TODO
# workaround
Git::Location.new(url.to_s.gsub('.git', '.wiki.git'))
# i.e. This replaces the last occurence of the string (case sensitive)
# and attaches everything before to the new substring
Git::Location.new(url.to_s.gsub(/(.*)\bgit\b/i, '\1wiki.git'))
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment