Skip to content

Commit edb88ed

Browse files
authored
Fix archive-source command (#3876)
Motivation: Source archives created using the `archive-source` command doesn't include top-level directory. Modification: The trailing slash `/` in the `--prefix` argument to `git archive`, which is the underlying command for `archive-source`, is required to create top level directory. Without it the prefixed to all the files and dirs in the archive.
1 parent 2509112 commit edb88ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SourceControl/GitRepository.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ public final class GitRepository: Repository, WorkingCheckout {
536536
try self.lock.withLock {
537537
try callGit("archive",
538538
"--format", "zip",
539-
"--prefix", path.basenameWithoutExt,
539+
"--prefix", "\(path.basenameWithoutExt)/",
540540
"--output", path.pathString,
541541
"HEAD",
542542
failureMessage: "Couldn’t create an archive")

0 commit comments

Comments
 (0)