Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow sources to do their own matching

They know it better, after all
  • Loading branch information...
commit a85911417d0d57924de02a20866de771e6d7369c 1 parent 12b3d39
@pieter authored
View
4 lib/git.rb
@@ -28,9 +28,7 @@ def git_channel(channel)
end
def handle_extended(channel, repo, ref, tree)
- match = repo ? /\b#{repo}\.git/ : nil
-
- l = channel.lookup(ref, match, tree)
+ l = channel.lookup(ref, repo, tree)
# Fail loudly if there is no match, but there is a tree or repo specified
if !l && (tree || repo)
View
2  lib/git/sources/gitweb.rb
@@ -23,7 +23,7 @@ def name
end
def matches?(match)
- return @url =~ match
+ return @url =~ /\b#{match}[a-z]*\.git/
end
def object_url(ref, file)
View
4 test/gitweb/sources/gitweb.rb
@@ -18,8 +18,8 @@ def test_object_url
end
def test_matches
- assert(@source.matches?(/gitbot/))
- assert(@source.matches?(/gitbot.git/))
+ assert(@source.matches?("gitbot"))
+ assert(@source.matches?("git"))
end
def test_lookup_HEAD
View
3  test/gitweb/sources/repo.rb
@@ -18,8 +18,7 @@ def test_object_url
end
def test_matches
- assert(@source.matches?(/git/))
- assert(@source.matches?(/git.git/))
+ assert(@source.matches?("git"))
end
def test_lookup_HEAD
Please sign in to comment.
Something went wrong with that request. Please try again.