Issue Summary
Mirror appends a numeric suffix (e.g. "-01") to the repo slug in the clone URL when a repo is deleted and then recreated on the upstream while the mirror is not running.
This can also occur in case there were network or communication issues between the upstream and the mirror when the repo was deleted and recreated.
This is reproducible on Data Center: yes
Steps to Reproduce
- Set up a mirror
- Create new project and a new repo
sample project: "test-proj"
sample repo slug: "test-repo" - Add the "test-proj" to the list of mirrored projects
Repo "test-repo" gets sync'd to the mirror
The clone URL from the mirror is: "ssh://git@bbmirror:7999/bitbucketdc/test-proj/test-repo.git" - Shut down the mirror
- Delete the repository "test-repo"
- Recreate the repository in the same project. Use the same repo slug "test-repo"
- Start up the mirror
The recreated "test-repo" gets sync'd to the mirror
However, the clone URL is now: "ssh://git@bbmirror:7999/bitbucketdc/test-proj/test-repo-01.git"
A numeric suffix, "-01" was appended to the slug in the mirror clone URL
Expected Results
The mirror clone URL will be the same as the upstream clone URL, without the numeric suffix.
For the sample above, it should still be: "ssh://git@bbmirror:7999/bitbucketdc/test-proj/test-repo.git"
Actual Results
A numeric suffix ("-01") is appended to the slug in the mirror clone URL, e.g. "ssh://git@bbmirror:7999/bitbucketdc/test-proj/test-repo-01.git"
Workaround
To update the mirror clone URL and remove the numeric suffix:
- Temporarily move the repo to a project that is not being mirrored
This will delete the repo from the mirror - Afterwards, move back the repo to the mirrored project
This will re-sync the repo to the mirror
The mirror clone URL should now be the same as the upstream clone URL, without the numeric suffix