From 462f49ffe9de896d66d22379ff7930f0ef1a05d3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 31 Jan 2008 21:17:15 -0500 Subject: [PATCH] only turn on create_missing in commit/checkout --- pristine-tar | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pristine-tar b/pristine-tar index dcd1a9b..991759a 100755 --- a/pristine-tar +++ b/pristine-tar @@ -237,9 +237,11 @@ sub recreatetarball { debug("$file is listed in the manifest but may not be present in the source directory"); $full_sweep=1; - # Avoid tar failing on the nonexistent item by - # creating a dummy directory. - mkpath "$tempdir/workdir/$file"; + if ($options{create_missing}) { + # Avoid tar failing on the nonexistent item by + # creating a dummy directory. + mkpath "$tempdir/workdir/$file"; + } } if (-d "$tempdir/workdir/$file" && (-u _ || -g _ || -k _)) { @@ -561,7 +563,8 @@ sub commit { my $tempdir=tempdir(); my ($sourcedir, $id)=export($upstream); genmanifest($tarball, "$tempdir/manifest"); - recreatetarball($tempdir, $sourcedir, clobber_source => 1); + recreatetarball($tempdir, $sourcedir, clobber_source => 1, + create_missing => 1); my $pid = open(GENDELTA, "-|"); if (! $pid) { # child @@ -585,7 +588,7 @@ sub checkout { # child $tarball=abs_path($tarball); chdir($sourcedir) || die "chdir $sourcedir: $!"; - gentar("-", $tarball, clobber_source => 1); + gentar("-", $tarball, clobber_source => 1, create_missing => 1); exit 0; } print GENTAR $delta; -- 2.7.4