Skip to contentSkip to conversation

Add JGit IO module as dependency to the main module

PATCH New [email protected] 1 participant 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add JGit IO module as dependency to the main module

From: Imran M Yousuf <[email protected]>

---
 jgit-maven/jgit/pom.xml |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
jgit-maven/jgit/pom.xml +6 -0
index 9eb5758..7176db9 100644
@@ -62,6 +62,12 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>jgit-io</artifactId>
+            <version>${project.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>com.jcraft</groupId>
             <artifactId>jsch</artifactId>
             <version>0.1.41</version>
Signature · 1 line
1.6.2.1
#1 lore raw

PATCH 2/2 Introduce IO SPI usage in RepositoryConfig

From: Imran M Yousuf <[email protected]>

In order to introduce IO SPI in repository config class file based config, file lock and NB is converted to use the IO SPI instead of java.io.File

Next is object directory.

---
 .../src/org/eclipse/jgit/lib/FileBasedConfig.java  |   12 +-
 .../src/org/eclipse/jgit/lib/LockFile.java         |  839 ++++++++++----------
 .../src/org/eclipse/jgit/lib/RepositoryConfig.java |    4 +-
 org.eclipse.jgit/src/org/eclipse/jgit/util/NB.java |   54 ++-
 4 files changed, 495 insertions(+), 414 deletions(-)

rewrite org.eclipse.jgit/src/org/eclipse/jgit/lib/LockFile.java (78%)

org.eclipse.jgit/src/org/eclipse/jgit/lib/FileBasedConfig.java +6 -6
index 1300d85..a952be5 100644
@@ -40,11 +40,11 @@
  */
 package org.eclipse.jgit.lib;
 
-import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 
 import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.io.Entry;
 import org.eclipse.jgit.util.NB;
 import org.eclipse.jgit.util.RawParseUtils;
 
@@ -52,7 +52,7 @@
  * The configuration file that is stored in the file of the file system.
  */
 public class FileBasedConfig extends Config {
-	private final File configFile;
+	private final Entry configFile;
 
 	/**
 	 * Create a configuration with no default fallback.
@@ -60,7 +60,7 @@
 	 * @param cfgLocation
 	 *            the location of the configuration file on the file system
 	 */
-	public FileBasedConfig(File cfgLocation) {
+	public FileBasedConfig(Entry cfgLocation) {
 		this(null, cfgLocation);
 	}
 
@@ -72,13 +72,13 @@ public FileBasedConfig(File cfgLocation) {
 	 * @param cfgLocation
 	 *            the location of the configuration file on the file system
 	 */
-	public FileBasedConfig(Config base, File cfgLocation) {
+	public FileBasedConfig(Config base, Entry cfgLocation) {
 		super(base);
 		configFile = cfgLocation;
 	}
 
 	/** @return location of the configuration file on disk */
-	public final File getFile() {
+	public final Entry getFile() {
 		return configFile;
 	}
 
@@ -135,6 +135,6 @@ public void save() throws IOException {
 
 	@Override
 	public String toString() {
-		return getClass().getSimpleName() + "[" + getFile().getPath() + "]";
+		return getClass().getSimpleName() + "[" + getFile().getName() + "]";
 	}
 }
\ No newline at end of file
org.eclipse.jgit/src/org/eclipse/jgit/lib/LockFile.java +434 -405

839 lines not on this page · raw message

org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryConfig.java +2 -2
index 117e44a..851998e 100644
@@ -41,7 +41,7 @@
 
 package org.eclipse.jgit.lib;
 
-import java.io.File;
+import org.eclipse.jgit.io.Entry;
 
 /**
  * An object representing the Git config file.
@@ -63,7 +63,7 @@
 	 * @param cfgLocation
 	 *            path of the file to load (or save).
 	 */
-	public RepositoryConfig(final Config base, final File cfgLocation) {
+	public RepositoryConfig(final Config base, final Entry cfgLocation) {
 		super(base, cfgLocation);
 	}
 
org.eclipse.jgit/src/org/eclipse/jgit/util/NB.java +53 -1

87 lines not on this page · raw message

Signature · 1 line
1.6.2.1