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

[JGIT PATCH 1/2] Cleanup Transport.applyConfig to use setter methods more consistently

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 21, 2009, 01:21 UTC
Message-ID
<1245547316-10299-1-git-send-email-spearce@spearce.org>

This just struck me as odd that we sometimes used a setter method, and sometimes used direct assignment to the field. Now we use the setter method if it is available. The fetch and push refspecs do not have setters, so must still be done by direct field assignment.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/transport/Transport.java  |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
index 1068f50..c36ccdd 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/Transport.java
@@ -568,9 +568,9 @@ public void setRemoveDeletedRefs(final boolean remove) {
 	 */
 	public void applyConfig(final RemoteConfig cfg) {
 		setOptionUploadPack(cfg.getUploadPack());
-		fetch = cfg.getFetchRefSpecs();
+		setOptionReceivePack(cfg.getReceivePack());
 		setTagOpt(cfg.getTagOpt());
-		optionReceivePack = cfg.getReceivePack();
+		fetch = cfg.getFetchRefSpecs();
 		push = cfg.getPushRefSpecs();
 	}
 
-- 
1.6.3.2.416.g04d0
Next: Shawn O. Pearce
Message 1 of 4 in “Cleanup Transport.applyConfig to use setter methods more consistently”
  1. 1/2 Cleanup Transport.applyConfig to use setter methods more consistentlyShawn O. Pearce, Jun 21, 2009
  2. 2/2 Add support for remote.name.pushurlShawn O. Pearce, Jun 21, 2009
  3. Robin RosenbergJun 21, 2009
  4. Shawn O. PearceJun 23, 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.