Browse Source

Add git-fix shim to fix local repo corruptions

main
parent
commit
c3ac18a45c
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 15
      README.org
  2. 15
      modules/git.nix

15
README.org

@ -1291,7 +1291,20 @@ Git[fn:37] is a free and open source distributed version control system designed
# <<file-warning>>
{ pkgs, ... }:
{
let
# Fix any corruptions in the local copy.
myGitFix = pkgs.writeShellScriptBin "git-fix" ''
if [ -d .git/objects/ ]; then
find ./git/objects/ -type f -empty | xargs rm -f
git fetch -p
git fsck --full
fi
exit 1
'';
in {
home.packages = [ myGitFix ];
programs.git = {
enable = true;
userName = "Christopher James Hayward";

15
modules/git.nix

@ -1,7 +1,20 @@
# This file is controlled by /etc/dotfiles/README.org
{ pkgs, ... }:
{
let
# Fix any corruptions in the local copy.
myGitFix = pkgs.writeShellScriptBin "git-fix" ''
if [ -d .git/objects/ ]; then
find ./git/objects/ -type f -empty | xargs rm -f
git fetch -p
git fsck --full
fi
exit 1
'';
in {
home.packages = [ myGitFix ];
programs.git = {
enable = true;
userName = "Christopher James Hayward";

Loading…
Cancel
Save