Przeglądaj źródła

delete the reflog

Frank suggested that deleting the reflog would free some more space and maybe
make the git-gc more efficient.

There does not seem to be a way to do it using git-reflog expire, so use rm.
Joey Hess 19 lat temu
rodzic
commit
885d95d062
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      scripts/Dpkg/Source/VCS/git.pm

+ 5 - 1
scripts/Dpkg/Source/VCS/git.pm

@@ -137,7 +137,11 @@ sub prep_tar {
 	system("cp", "-a", "$srcdir/.git", $tardir);
 	$? && main::subprocerr("cp -a $srcdir/.git $tardir");
 
-	# garbage collect the new repo
+	# Clean up the new repo to save space.
+	# First, delete the whole reflog, which is not needed in a
+	# distributed source package.
+	system("rm", "-rf", "$tardir/.git/logs");
+	$? && main::subprocerr("rm -rf $tardir/.git/logs");
 	system("cd $tardir && git-gc --prune");
 	$? && main::subprocerr("cd $tardir && git-gc --prune");