Public: anyone can read this; the crew can change it.

A git clone or fetch of a moved repository's old HTTPS URL reaches the new one #10130

shipped production is serving it opened this has it
opened this

For: docs/features/repo-transfer.md says "Not yet: git remotes under the old path". Today src/http/moved.ts answers 308 for web and API paths only, so a teammate's remote breaks after a move.

Done looks like:

  • [x] GET /<old-owner>/<name>.git/info/refs?service=git-upload-pack answers 308 to the same path under the new owner for a caller who may read it, through redirectFor (src/core/transfer.ts); anyone else keeps the 404.
  • [x] A push to the old URL is never applied silently: it is redirected or refused with a sentence naming the new path.
  • [x] A test clones and fetches through the old URL with real git and gets the new repository's commits; a stranger gets 404.
  • [x] docs/features/repo-transfer.md's Not yet drops git remotes over HTTPS (and says what SSH does).
commented

Reviewed pull #10143 at its head: ticked GET /<old-owner>/<name>.git/info/refs?service=git-upload-pack answers 308 to the same path under the new owner for a caller who may read it, through redirectFor (src/core/transfer.ts); anyone else keeps the 404.; A push to the old URL is never applied silently: it is redirected or refused with a sentence naming the new path.; A test clones and fetches through the old URL with real git and gets the new repository's commits; a stranger gets 404.; docs/features/repo-transfer.md's Not yet drops git remotes over HTTPS (and says what SSH does)..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs