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

[JGIT PATCH 1/3] Fix push's RemoteRefUpdate to always force update local TrackingRefUpdate

From
MZMarek Zawirski <marek.zawirski@gmail.com>
Date
Aug 28, 2008, 02:32 UTC
Message-ID
<1219890769-20119-2-git-send-email-marek.zawirski@gmail.com>
In-Reply-To
<1219890769-20119-1-git-send-email-marek.zawirski@gmail.com>

Now, we force update local tracking ref even if we do not force remote ref update. It seems to be sensible approach (C git one) assuming that our repository may be out of sync with the remote one. The potentially lost information here isn't so valuable perhaps.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
---
 .../spearce/jgit/transport/RemoteRefUpdate.java    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
index fd19300..623599f 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteRefUpdate.java
@@ -189,7 +189,7 @@ public RemoteRefUpdate(final Repository localDb, final String srcRef,
 		this.forceUpdate = forceUpdate;
 		if (localName != null && localDb != null)
 			trackingRefUpdate = new TrackingRefUpdate(localDb, localName,
-					remoteName, forceUpdate, newObjectId, "push");
+					remoteName, true, newObjectId, "push");
 		else
 			trackingRefUpdate = null;
 		this.localDb = localDb;
-- 
1.5.6.3
Previous: Marek ZawirskiNext: Marek Zawirski
Message 2 of 4 in “Fix local tracking refs updates during push”
  1. 0/3 Fix local tracking refs updates during pushMarek Zawirski, Aug 28, 2008
  2. 1/3 Fix push's RemoteRefUpdate to always force update local TrackingRefUpdateMarek Zawirski, Aug 28, 2008
  3. 2/3 Add another delete method in RefUpdate, reusing RevWalkMarek Zawirski, Aug 28, 2008
  4. 3/3 Fix RemoteRefUpdate to delete local tracking ref upon successful deletionMarek Zawirski, Aug 28, 2008

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.