Explorar el Código

ignore GIT_ environment variables

Joey Hess hace 19 años
padre
commit
7455ecdd1c
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      scripts/Dpkg/Source/VCS/git.pm

+ 8 - 0
scripts/Dpkg/Source/VCS/git.pm

@@ -28,6 +28,14 @@ use Dpkg::Gettext;
 push (@INC, $dpkglibdir);
 require 'controllib.pl';
 
+# Remove variables from the environment that might cause git to do
+# something unexpected.
+delete $ENV{GIT_DIR};
+delete $ENV{GIT_INDEX_FILE};
+delete $ENV{GIT_OBJECT_DIRECTORY};
+delete $ENV{GIT_ALTERNATE_OBJECT_DIRECTORIES};
+delete $ENV{GIT_WORK_TREE};
+
 # Called before a tarball is created, to prepare the tar directory.
 sub prep_tar {
 	my $srcdir=shift;