Kentzo/git-archive-all

tarbomb is created when no prefix is specified

pgraham opened this issue · 3 comments

Step to reproduce:

1. Run the command in the root of a git repository without specifying a prefix
    $ cd /path/to/my-repo
    $ mkdir releases
    $ git-archive-all releases/my-repo-1.0.tar.gz
2. Extract the archive created in step 1
    $ cd releases
    $ tar -xzf my-repo-1.0.tar.gz

Expected result:

A directory named my-repo-1.0 is created at /path/to/my-repo/releases containing the contents of the archive

Actual result:

The contents of the archive are found directly in /path/to/my-repo/releases

The problem is not limited to archives created using the tarfile module.

@pgraham Can you confirm that issue can be considered fixed?

Hi, I confirm that a Tarbomb is no longer created. However, if the name of the archive contains a dot (.), then it and everything after will be dropped from the prefix:

$ git-archive-all myrepo-1.0.tar.gz
$ tar -xzf myrepo-1.0.tar.gz
$ ls
myrepo-1