summaryrefslogtreecommitdiff
path: root/git-import-orig
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-06-26 14:45:05 +0200
committerGuido Günther <agx@sigxcpu.org>2010-06-26 14:45:05 +0200
commit3bcb1ef18fda2032a1f7bb94ff29370f62067967 (patch)
tree281e557c3f8f6bef6b99a135d9e1e7e9108f06bc /git-import-orig
parent077bdb0107b1da8af5de89caf247fbaa2dcd18e1 (diff)
downloadgit-buildpackage-3bcb1ef18fda2032a1f7bb94ff29370f62067967.tar.gz
git-buildpackage-3bcb1ef18fda2032a1f7bb94ff29370f62067967.tar.bz2
git-buildpackage-3bcb1ef18fda2032a1f7bb94ff29370f62067967.zip
Abort if upstream tarball contains git metadata
Closes: #571717
Diffstat (limited to 'git-import-orig')
-rwxr-xr-xgit-import-orig8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-import-orig b/git-import-orig
index 76934f37..e2e0c4f5 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -293,6 +293,14 @@ on howto create it otherwise use --upstream-branch to specify it.
if options.verbose:
print "Unpacked %s to '%s'" % (archive , tmpdir)
orig_dir = tar_toplevel(tmpdir)
+
+ # Don't mess up or repo with git metadata from an upstream tarball
+ try:
+ if os.path.isdir(os.path.join(orig_dir, '.git/')):
+ raise GbpError, "The orig tarball contains .git metadata - giving up."
+ except OSError:
+ pass
+
if options.pristine_tar and options.filter_pristine_tar and len(options.filters) > 0:
if options.verbose:
print "Filter pristine-tar: repacking %s from '%s'" % (archive, tmpdir)