Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11766

Deleting repository fork after moving repository and fork can delete original repository



    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.15.0, 6.3.0
    • Fix Version/s: 6.4.0
    • Component/s: None
    • Labels:


      Issue Summary

      When attempting to swap the location of a repo and its fork, deleting the fork after swapping can cause the original repo to be deleted. This is caused by a UI problem which causes the user to think the repository delete did not function correctly, resulting in a second delete attempt which deletes the original repo.

      Steps to Reproduce

      Issue reproduced on both Bitbucket Server 5.15.0 and 6.3.0

      1. Create three projects PROJ-A, PROJ-B, PROJ-C
      2. Create repo in PROJ-A: PROJ-A/my-repo
        • PROJ-A/my-repo (original)
        • PROJ-B (empty)
        • PROJ-C (empty)
      3. Move repo to PROJ-B: PROJ-B/my-repo
        • PROJ-A (empty)
        • PROJ-B/my-repo (original)
        • PROJ-C (empty)
      4. Fork repo back to PROJ-A (uncheck 'Enable fork syncing'): PROJ-A/my-repo
        • PROJ-A/my-repo (fork)
        • PROJ-B/my-repo (original)
        • PROJ-C (empty)
      5. Move original repo to PROJ-C: PROJ-C/my-repo
        • PROJ-A/my-repo (fork)
        • PROJ-B (empty)
        • PROJ-C/my-repo (original)
      6. Move fork to PROJ-B: PROJ-B/my-repo
        • PROJ-A (empty)
        • PROJ-B/my-repo (fork)
        • PROJ-C/my-repo (original)
      7. Move original repo to PROJ-A: PROJ-A/my-repo
        • PROJ-A/my-repo (original)
        • PROJ-B/my-repo (fork)
        • PROJ-C (empty)
      8. Delete fork repo PROJ-B/my-repo
        • Selecting 'Delete repository' will bring up the confirmation dialog

      Expected Results

      Fork repo is deleted, and the user is returned back to the project

      Actual Results

      Selecting 'Delete' will appear to run, but then returns to the fork repo's settings rather than the project view

      • This is when the fork is deleted, but to the user it looks like the delete did not work for some reason
      • The original repo still exists at this point

      Selecting 'Delete repository' again will bring up the confirmation dialog

      • Selecting 'Delete' will now appear to perform the normal delete action and return to the project view (in this case PROJ-B)
      • This is when the original repo is deleted


      • This does not occur when the repo is just moved, then forked, then the fork is deleted. The swap is required to cause the original repo to be deleted.
      • This may be due to the alias table added by: https://jira.atlassian.com/browse/BSERV-3751


      Prior to deletion of the fork, ensure that repository is moved to a new/unused location.


          Issue Links



              ysun Yingran Sun
              eslaughter@atlassian.com Evan Slaughter
              2 Vote for this issue
              6 Start watching this issue