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.gitbackup-pull it:
$ mkdir backup && cd backup && git init
$ git-backup pull ../slapos.git/:slaposwhen restoring:
$ git-backup restore HEAD slapos:../slapos.restored
$ cd .. && git clone slapos.restored slapos_bis
fatal: repository 'slapos.restored' does not existAs @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.gitgives:
$ cd ../slapos.restored.git && git log
commit 5f5d5102cf2dd2b4a8d092e32dfc6b87fa3bbc12
Author: [...]