summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2013-04-26 13:47:56 -0700
committerJonathan Nieder <jrn@google.com>2013-04-26 14:12:42 -0700
commitbe047307fcd179934e0cd3a0cf4ffe9c758d5370 (patch)
treed57e75908fb0c2430afa8e2e501159f2717acb81
parentb525e696d558bee033652d847b18514e5656fbda (diff)
downloadjgit-be047307fcd179934e0cd3a0cf4ffe9c758d5370.tar.gz
jgit-be047307fcd179934e0cd3a0cf4ffe9c758d5370.zip
ArchiveCommand: Do not warn for unsupported file mode
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 4808df995e..3d6952bc93 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 727317b839..c6f913c681 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 eaa80aee25..7c2e7c0993 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);