Skip to content

Repository that ends with ".git" is not cloned

Created by: mike-r-mclaughlin

Steps to reproduce:

  1. Create a new repository in Bitbucket (GitHub will not allow you to create a repo that ends with .git it seems) called test.git image

  2. Add this repository to Sourcegraph

Example

{
  "url": "https://bitbucket.example.org",
  "token": "REDACTED",
  "username": "test",
  "repos": [
    "test/test.git",
    "test/test-repository"
  ]
}
  1. Go to the Repository status page

Expected behavior:

Repository test.git is cloned and searchable

Actual behavior:

Repository status page shows: image

gitserver logs show: 17:58:04 gitserver | {"SeverityText":"WARN","Timestamp":1660586284538288671,"InstrumentationScope":"server.handleRepoUpdate","Caller":"server/server.go:912","Function":"github.com/sourcegraph/sourcegraph/cmd/gitserver/server.(*Server).handleRepoUpdate","Body":"error cloning repo","Resource":{"service.name":"gitserver","service.version":"3.42.1","service.instance.id":"127.0.0.1:3178"},"Attributes":{"repo":"bitbucket.example.org/test/test","error":"get VCS syncer: get repository: repo not found: name=\"bitbucket.example.org/test/test\""}}

/cc @jplahn @ryphil