aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
index 2e6b50a6a5..ed91ae22e8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
@@ -279,11 +279,18 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
walk.reset(rw.parseTree(tree));
while (walk.next()) {
final String name = pfx + walk.getPathString();
- final FileMode mode = walk.getFileMode(0);
+ FileMode mode = walk.getFileMode(0);
- if (walk.isSubtree()) {
- fmt.putEntry(outa, name + "/", mode, null);
+ if (walk.isSubtree())
walk.enterSubtree();
+
+ if (mode == FileMode.GITLINK)
+ // TODO(jrn): Take a callback to recurse
+ // into submodules.
+ mode = FileMode.TREE;
+
+ if (mode == FileMode.TREE) {
+ fmt.putEntry(outa, name + "/", mode, null);
continue;
}
walk.getObjectId(idBuf, 0);