summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2013-05-23 16:46:29 -0700
committerJonathan Nieder <jrn@google.com>2013-05-23 18:09:04 -0700
commitd8177d6e195fad752de69f9bdeacbf6f6e004d2b (patch)
treee86bcc81cc0bb628b416df92232eeeb44015e9ec /org.eclipse.jgit.pgm
parentd4932620e067a19a8cc22170fd133cc53aca2ddb (diff)
downloadjgit-d8177d6e195fad752de69f9bdeacbf6f6e004d2b.tar.gz
jgit-d8177d6e195fad752de69f9bdeacbf6f6e004d2b.zip
ArchiveCommand.Format: pass output stream as first argument to putEntry
This is more consistent with other APIs where the output side is the first parameter to be analagous to the left-hand side of an assignment. Change-Id: Iec46bd50bc973a38b77d8367296adf5474ba515f
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ArchiveCommand.java9
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java5
3 files changed, 10 insertions, 9 deletions
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 ff5b0d0cd3..ad1daebd42 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
@@ -106,7 +106,7 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
* ArchiveOutputStream out = format.createArchiveOutputStream(System.out);
* try {
* for (...) {
- * format.putEntry(path, mode, repo.open(objectId), out);
+ * format.putEntry(out, path, mode, repo.open(objectId));
* }
* } finally {
* out.close();
@@ -114,9 +114,8 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
*/
public static interface Format {
ArchiveOutputStream createArchiveOutputStream(OutputStream s);
- void putEntry(String path, FileMode mode, //
- ObjectLoader loader, ArchiveOutputStream out) //
- throws IOException;
+ void putEntry(ArchiveOutputStream out, String path, FileMode mode,
+ ObjectLoader loader) throws IOException;
}
/**
@@ -204,7 +203,7 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
continue;
walk.getObjectId(idBuf, 0);
- fmt.putEntry(name, mode, reader.open(idBuf), outa);
+ fmt.putEntry(outa, name, mode, reader.open(idBuf));
}
} finally {
outa.close();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java
index c27fb350b9..a0bbd52403 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/TarFormat.java
@@ -57,8 +57,9 @@ class TarFormat implements ArchiveCommand.Format {
return new TarArchiveOutputStream(s);
}
- public void putEntry(String path, FileMode mode, ObjectLoader loader,
- ArchiveOutputStream out) throws IOException {
+ public void putEntry(ArchiveOutputStream out,
+ String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
if (mode == FileMode.SYMLINK) {
final TarArchiveEntry entry = new TarArchiveEntry(
path, TarConstants.LF_SYMLINK);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java
index d08428f54a..a85ae3bfa8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/archive/ZipFormat.java
@@ -56,8 +56,9 @@ class ZipFormat implements ArchiveCommand.Format {
return new ZipArchiveOutputStream(s);
}
- public void putEntry(String path, FileMode mode, ObjectLoader loader,
- ArchiveOutputStream out) throws IOException {
+ public void putEntry(ArchiveOutputStream out,
+ String path, FileMode mode, ObjectLoader loader)
+ throws IOException {
final ZipArchiveEntry entry = new ZipArchiveEntry(path);
if (mode == FileMode.REGULAR_FILE) {