diff --git a/README.org b/README.org index 8bcbaa5..b896653 100644 --- a/README.org +++ b/README.org @@ -1291,7 +1291,20 @@ Git[fn:37] is a free and open source distributed version control system designed # <> { 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"; diff --git a/modules/git.nix b/modules/git.nix index fbfa79b..49d140a 100644 --- a/modules/git.nix +++ b/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";