Skip to content
Snippets Groups Projects

Fix for #8271: Correctly restore empty repositories.

Merged gitlab-qa-bot requested to merge bug8271 into master

Created by: ghost

If a project is being restored, but there is no bundle file, the project was empty when it was backed up. In this case, just use git init --base to create a new bare repository.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
59 59
60 60 project.namespace.ensure_dir_exist if project.namespace
61 61
62 if system(*%W(git clone --bare #{path_to_bundle(project)} #{path_to_repo(project)}), silent)
62 if File.exists?(path_to_bundle(project))
63 cmd = %W(git clone --bare #{path_to_bundle(project)} #{path_to_repo(project)})
  • Created by: houndci-bot

    Line is too long. [88/80]

    By Administrator on 2014-11-13T12:19:30 (imported from GitLab project)

    By Administrator on 2014-11-13T12:19:30 (imported from GitLab)

  • Created by: axilleas

    \cc @jacobvosmaer

    By Administrator on 2014-11-13T12:59:53 (imported from GitLab project)

    By Administrator on 2014-11-13T12:59:53 (imported from GitLab)

  • Created by: jacobvosmaer

    Thanks @dandric-activevideo

    By Administrator on 2014-11-13T14:35:01 (imported from GitLab project)

    By Administrator on 2014-11-13T14:35:01 (imported from GitLab)

  • Created by: bbodenmiller

    @dandric-activevideo before this was implemented what happened when you restored empty repos? I need to do a restore before the 7.5 release and am wondering if I will have issues.

    By Administrator on 2014-11-14T08:15:46 (imported from GitLab project)

    By Administrator on 2014-11-14T08:15:46 (imported from GitLab)

  • Created by: ghost

    @bbodenmiller, as you can see in #8271 (closed) and #8293 (closed), the restore operation errored out, e.g.:

    Restoring repositories ...
    [... lots of repos restore fine ...]
    sveer/sander ... [FAILED]
    Restore failed

    In the above example the 'sveer/sander' project was just created, but did not have any commits pushed to it yet.

    As a workaround, you can either delete all empty projects before creating a backup, or you can just locally apply 4e65d085 before attempting the restore.

    By Administrator on 2014-11-14T08:43:57 (imported from GitLab project)

    By Administrator on 2014-11-14T08:43:57 (imported from GitLab)

  • Created by: bbodenmiller

    Thanks, I will apply locally... totally missed the title of this PR!

    By Administrator on 2014-11-14T09:29:07 (imported from GitLab project)

    By Administrator on 2014-11-14T09:29:07 (imported from GitLab)

  • Please register or sign in to reply
    Loading