Backport #28844 by @AdamMajer Git 2.43.0 will not detect a git repository as valid without refs/ subdirectory present. `git gc` cleans this up and puts it in packed-refs. We must keep refs/ non-empty. Co-authored-by: Adam Majer <amajer@suse.de>