diff options
author | Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp> | 2017-04-29 20:35:10 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2017-06-05 19:35:46 -0400 |
commit | a66e60a98620c5ba9cd3d9fc8f97f268229589e6 (patch) | |
tree | 6ebd94aef1c6c634ad14a9bde84a20168c24a3c1 /org.eclipse.jgit.pgm.test/tst/org | |
parent | 6b1e3c58b16651dc72ec79a614d507e014d18393 (diff) | |
download | jgit-a66e60a98620c5ba9cd3d9fc8f97f268229589e6.tar.gz jgit-a66e60a98620c5ba9cd3d9fc8f97f268229589e6.zip |
ArchiveCommand: Create prefix entry with commit time
The cgit archive command creates a prefix (root) directory entry
in the archive file. That entry's time is set to the commit time.
This patch makes jgit's behavior consistent with with cgit:
prefix: hoge/ -> creates prefix directory "hoge/" entry.
prefix: hoge//// -> creates prefix directory "hoge/" entry.
prefix: hoge/foo -> does not create prefix directory entry, but for
each file/directory entry, prefix is added.
Change-Id: I2610e40ce37972c5f7456fdca6337e7fb07176e5
Signed-off-by: Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst/org')
-rw-r--r-- | org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java index 18c49ea286..6f32bfaa52 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java @@ -348,7 +348,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitBazAndFooSlashBar(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x/ --format=zip master", db).outBytes(); - String[] expect = { "x/baz", "x/foo/", "x/foo/bar" }; + String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" }; String[] actual = listZipEntries(result); Arrays.sort(expect); @@ -361,7 +361,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitBazAndFooSlashBar(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x/ --format=tar master", db).outBytes(); - String[] expect = { "x/baz", "x/foo/", "x/foo/bar" }; + String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" }; String[] actual = listTarEntries(result); Arrays.sort(expect); @@ -380,7 +380,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitFoo(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x// --format=zip master", db).outBytes(); - String[] expect = { "x//foo" }; + String[] expect = { "x/", "x//foo" }; assertArrayEquals(expect, listZipEntries(result)); } @@ -389,7 +389,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitFoo(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x// --format=tar master", db).outBytes(); - String[] expect = { "x//foo" }; + String[] expect = { "x/", "x//foo" }; assertArrayEquals(expect, listTarEntries(result)); } |