Skip to content

Commit

Permalink
Use non-matching group
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Rudolph <johannes.rudolph@gmail.com>
  • Loading branch information
raboof and jrudolph committed Apr 1, 2020
1 parent e023065 commit 4e4f2cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/com/typesafe/sbt/SbtGit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ object SbtGit {
scmInfo := {
val user = """(?:[^@\/]+@)?"""
val domain = """([^\/]+)"""
val gitPath = """(.*)(\.git)?\/?"""
val gitPath = """(.*)(?:\.git)?\/?"""
val unauthenticated = raw"""(?:git|https?|ftps?)\:\/\/$domain\/$gitPath""".r
val ssh = raw"""ssh\:\/\/$user$domain\/$gitPath""".r
val headlessSSH = raw"""$user$domain:$gitPath""".r
Expand All @@ -138,9 +138,9 @@ object SbtGit {
)

gitReader.value.withGit(_.remoteOrigin) match {
case unauthenticated(domain, repo, _) => buildScmInfo(domain,repo)
case ssh(domain, repo, _) => buildScmInfo(domain,repo)
case headlessSSH(domain, repo, _) => buildScmInfo(domain,repo)
case unauthenticated(domain, repo) => buildScmInfo(domain,repo)
case ssh(domain, repo) => buildScmInfo(domain,repo)
case headlessSSH(domain, repo) => buildScmInfo(domain,repo)
case _ => None
}
}
Expand Down

0 comments on commit 4e4f2cb

Please sign in to comment.