Skip to content

dev/fakehub: remove "/.git" from exposed name

Warren Gifford requested to merge jc/fakehub-clone-url into master

Created by: unknwon

Remove "/.git" suffix from the repo name. The generated Sourcegraph config text now looks like:

// Paste this into Site admin | External services | Add external service | Single Git repositories:
{
  "url": "http://127.0.0.1:3434",
  "repos": [
      "/repos/external-service-adapter",
      "/repos/lsif-go",
      "/repos/sourcegraph",
  ]
}

The changes made in this PR also works with -n=>2 or multiple level before hitting the ".git" directory (i.e. works as before).

Quick logs:

# Fakehub
2019/08/07 18:44:46 GET /repos/lsif-go/info/refs
2019/08/07 18:44:46 GET /repos/lsif-go/HEAD
2019/08/07 18:44:46 GET /repos/lsif-go/objects/72/883daa95a87409df80b4df3605505f2e7a3129
2019/08/07 18:44:46 GET /repos/lsif-go/objects/0c/24c6dd15aaefa8b71640a421ce37a3fffbb9c2
2019/08/07 18:44:46 GET /repos/lsif-go/objects/02/dd06277a8a4b6b90ebb0eec43a7bb6bd0090a6
2019/08/07 18:44:46 GET /repos/lsif-go/objects/ac/1557e5fb1f3b0dd084029ada11622c66730dfc
2019/08/07 18:44:46 GET /repos/lsif-go/objects/c0/e8dfd02154f3c6a417508c7b541d2675c36888
2019/08/07 18:44:46 GET /repos/lsif-go/objects/info/http-alternates
2019/08/07 18:44:46 GET /repos/lsif-go/objects/info/alternates

Old configs with "/.git" in place will also continue to work.

Merge request reports

Loading