From 09386db588344e81f598c8f9dbd57141de4ec844 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Mon, 11 Feb 2008 01:41:55 +0100 Subject: [PATCH] Dpkg::Source::VCS::git: Call git ls-files with -z * scripts/Dpkg/Source/VCS/git.pm(prep_tar): Call git ls-files with -z to correctly handle filenames with funny characters. --- scripts/Dpkg/Source/VCS/git.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/Dpkg/Source/VCS/git.pm b/scripts/Dpkg/Source/VCS/git.pm index 9caf2410..c7703889 100644 --- a/scripts/Dpkg/Source/VCS/git.pm +++ b/scripts/Dpkg/Source/VCS/git.pm @@ -117,15 +117,17 @@ sub prep_tar { push @ignores, "--exclude-from=.git/info/exclude"; } open(GIT_LS_FILES, '-|', "git", "ls-files", "--modified", "--deleted", - "--others", @ignores) || + "-z", "--others", @ignores) || subprocerr("git ls-files"); my @files; - while () { - chomp; - if (! length $main::diff_ignore_regexp || - ! m/$main::diff_ignore_regexp/o) { - push @files, $_; - } + { local $/ = "\0"; + while () { + chomp; + if (! length $main::diff_ignore_regexp || + ! m/$main::diff_ignore_regexp/o) { + push @files, $_; + } + } } close(GIT_LS_FILES) || syserr(_g("git ls-files exited nonzero")); if (@files) { -- 2.39.5