Re: [JGIT PATCH 0/3] Support for loading .gitmodules from blobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Constantine Plotnikov <constantine.plotnikov@xxxxxxxxx> wrote:
> This series of patches is developed to support accessing 
> .gitmodules file stored inside the repository. This functionality
> is needed for server-side processing of submodules.
> 
> Constantine Plotnikov (3):
>  Extracted functionality independent from .git/config from RepositoryConfig
>  Config.getSubsections(...) now loads the file if it has not been loaded
>  Added BlobBasedConfig that allows accessing configuration files stored in the blobs

Thanks, pushed, with a couple of minor edits that were just easier
to squash in than to ask you to fix and respin:

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
index 0385a3b..1f44994 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
@@ -136,10 +136,10 @@ protected InputStream openInputStream() throws IOException {
 			return new ByteArrayInputStream(blobProvider.call());
 		} catch (IOException e) {
 			throw e;
-		} catch (RuntimeException e) {
-			throw e;
 		} catch (Exception e) {
-			throw new RuntimeException(e);
+			final IOException e2 = new IOException("Unable to read config");
+			e2.initCause(e);
+			throw e2;
 		}
 	}
 }
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Config.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Config.java
index 4220c37..c2d5c6e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Config.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Config.java
@@ -84,8 +84,9 @@
 	 *            the base configuration file to be consulted when value is
 	 *            missing from this file
 	 */
-	public Config(Config base) {
+	protected Config(Config base) {
 		baseConfig = base;
+		clear();
 	}
 
 	/**
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
index a139386..9d2c9a3 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
@@ -108,7 +108,6 @@ public RepositoryConfig openUserConfig() {
 	 */
 	public RepositoryConfig(final RepositoryConfig base, final File cfgLocation) {
 		super(base, cfgLocation);
-		clear();
 	}
 
 	/**
 
-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]