Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
G git-backup
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • git-backup
  • Issues
  • #1

Closed
Open
Created Jul 01, 2016 by iv@iv

Empty dirs are not tracked (Restoring repo require their name to ends with ".git")

To reproduce the bug:

get some bare repo:

$ git clone --bare slapos slapos.git

backup-pull it:

$ mkdir backup && cd backup && git init
$ git-backup pull ../slapos.git/:slapos

when restoring:

$ git-backup restore HEAD slapos:../slapos.restored
$ cd .. && git clone slapos.restored slapos_bis
fatal: repository 'slapos.restored' does not exist

As @kirr explained me, it is due to git not tracking trees of empty directories:

$ls slapos.git/refs/ -Ra
slapos.git/refs/:
.  ..  heads  tags

slapos.git/refs/heads:
.  ..

slapos.git/refs/tags:
.  ..

So some directory that are used by the restored repo are missing. This is currently fixed by detecting if it is a git repo or not (it is also possible to backup usual folder/files) by verifying its extension. So it works fine when restoring this way:

$ git-backup restore HEAD slapos:../slapos.restored.git

gives:

$ cd ../slapos.restored.git && git log
commit 5f5d5102cf2dd2b4a8d092e32dfc6b87fa3bbc12
Author: [...]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7