aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Nieder2013-04-26 16:47:56 (EDT)
committerJonathan Nieder2013-04-26 17:12:42 (EDT)
commitbe047307fcd179934e0cd3a0cf4ffe9c758d5370 (patch)
treed57e75908fb0c2430afa8e2e501159f2717acb81
parentb525e696d558bee033652d847b18514e5656fbda (diff)
downloadjgit-be047307fcd179934e0cd3a0cf4ffe9c758d5370.zip
jgit-be047307fcd179934e0cd3a0cf4ffe9c758d5370.tar.gz
jgit-be047307fcd179934e0cd3a0cf4ffe9c758d5370.tar.bz2
ArchiveCommand: Do not warn for unsupported file moderefs/changes/52/12252/5
When ArchiveCommand is invoked directly on the command line, these warnings to stderr warning: mode of path/to/some/submodule ignored are a useful hint, but in the more usual case where an archive is being served by a server, the intended audience for that message cannot see stderr. Later it might be useful to accept a callback to return these warnings out of band. Change-Id: I22e79be69859176d85594031d67c6cb3371c4bd2
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java18
3 files changed, 7 insertions, 13 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
index 4808df9..3d6952b 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
@@ -7,7 +7,6 @@ N=N
alreadyOnBranch=Already on ''{0}''
alreadyUpToDate=Already up-to-date.
-archiveEntryModeIgnored=warning: mode of {0} ignored
authorInfo=Author: {0} <{1}>
averageMSPerRead=average {0} ms/read
branchAlreadyExists=A branch named ''{0}'' already exists.
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
index 727317b..c6f913c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
@@ -76,7 +76,6 @@ public class CLIText extends TranslationBundle {
// @formatter:off
/***/ public String alreadyOnBranch;
/***/ public String alreadyUpToDate;
- /***/ public String archiveEntryModeIgnored;
/***/ public String authorInfo;
/***/ public String averageMSPerRead;
/***/ public String branchAlreadyExists;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java
index eaa80ae..7c2e7c0 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java
@@ -43,7 +43,6 @@
package org.eclipse.jgit.pgm.archive;
import java.lang.String;
-import java.lang.System;
import java.io.IOException;
import java.io.OutputStream;
import java.util.EnumMap;
@@ -118,12 +117,6 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
throws IOException;
}
- private static void warnArchiveEntryModeIgnored(String name) {
- System.err.println(MessageFormat.format( //
- CLIText.get().archiveEntryModeIgnored, //
- name));
- }
-
private static final Map<Format, Archiver> formats;
static {
@@ -144,7 +137,8 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
|| mode == FileMode.SYMLINK) {
entry.setUnixMode(mode.getBits());
} else {
- warnArchiveEntryModeIgnored(path);
+ // TODO(jrn): Let the caller know the tree contained
+ // an entry with unsupported mode (e.g., a submodule).
}
entry.setSize(loader.getSize());
out.putArchiveEntry(entry);
@@ -172,10 +166,12 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
final TarArchiveEntry entry = new TarArchiveEntry(path);
if (mode == FileMode.REGULAR_FILE ||
- mode == FileMode.EXECUTABLE_FILE)
+ mode == FileMode.EXECUTABLE_FILE) {
entry.setMode(mode.getBits());
- else
- warnArchiveEntryModeIgnored(path);
+ } else {
+ // TODO(jrn): Let the caller know the tree contained
+ // an entry with unsupported mode (e.g., a submodule).
+ }
entry.setSize(loader.getSize());
out.putArchiveEntry(entry);
loader.copyTo(out);