git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 25, 2009, 00:26 UTC
Message-ID
<20090625002634.GI11191@spearce.org>
In-Reply-To
<1245865685-1288-1-git-send-email-constantine.plotnikov@gmail.com>
Constantine Plotnikov <constantine.plotnikov@gmail.com> wrote:
Show 8 quoted lines
> 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.
Previous: Constantine Plotnikov
Message 5 of 5 in “Support for loading .gitmodules from blobs”
  1. 0/3 Support for loading .gitmodules from blobsConstantine Plotnikov, Jun 24, 2009
  2. 1/3 Extracted functionality independent from .git/config from RepositoryConfigConstantine Plotnikov, Jun 24, 2009
  3. 2/3 Config.getSubsections(...) now loads the file if it has not been loadedConstantine Plotnikov, Jun 24, 2009
  4. 3/3 Added BlobBasedConfig that allows accessing configuration files stored in the blobsConstantine Plotnikov, Jun 24, 2009
  5. Shawn O. PearceJun 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.