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

[EGIT PATCH 09/10] Drop unused File arguments in IndexTreeWalker and WorkdirCheckout

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Mar 16, 2009, 20:14 UTC
Message-ID
<1237234483-3405-10-git-send-email-robin.rosenberg@dewire.com>
In-Reply-To
<1237234483-3405-9-git-send-email-robin.rosenberg@dewire.com>
---
 .../src/org/spearce/jgit/lib/IndexTreeWalker.java  |    8 ++++----
 .../src/org/spearce/jgit/lib/WorkDirCheckout.java  |    5 ++---
 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java b/org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java
index 5c7909a..e2078e1 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java
@@ -104,10 +104,10 @@ public IndexTreeWalker(GitIndex index, Tree mainTree, Tree newTree, File root, I
 	 * @throws IOException
 	 */
 	public void walk() throws IOException {
-		walk(mainTree, newTree, "");
+		walk(mainTree, newTree);
 	}
 
-	private void walk(Tree tree, Tree auxTree, String curDir) throws IOException {
+	private void walk(Tree tree, Tree auxTree) throws IOException {
 		TreeIterator mi = new TreeIterator(tree, TreeIterator.Order.POSTORDER);
 		TreeIterator ai = new TreeIterator(auxTree, TreeIterator.Order.POSTORDER);
 		TreeEntry m = mi.hasNext() ? mi.next() : null;
@@ -124,7 +124,7 @@ private void walk(Tree tree, Tree auxTree, String curDir) throws IOException {
 			Entry     pi = cmpmi >= 0 && cmpai >= 0 ? i : null;
 
 			if (pi != null)
-				visitEntry(pm, pa, pi, root);
+				visitEntry(pm, pa, pi);
 			else
 				finishVisitTree(pm, pa, curIndexPos, root);
 
@@ -135,7 +135,7 @@ private void walk(Tree tree, Tree auxTree, String curDir) throws IOException {
 	}
 
 	private void visitEntry(TreeEntry t1, TreeEntry t2,
-			Entry i, File root) throws IOException {
+			Entry i) throws IOException {
 
 		assert t1 != null || t2 != null || i != null : "Needs at least one entry";
 		assert root != null : "Needs workdir";
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java b/org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java
index d3da74a..8435223 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/WorkDirCheckout.java
@@ -259,7 +259,7 @@ public void visitEntry(TreeEntry treeEntry, TreeEntry auxEntry,
 				if (treeEntry instanceof Tree || auxEntry instanceof Tree) {
 					throw new IllegalArgumentException("Can't pass me a tree!");
 				}
-				processEntry(treeEntry, auxEntry, indexEntry, file);
+				processEntry(treeEntry, auxEntry, indexEntry);
 			}
 	
 			@Override
@@ -294,8 +294,7 @@ else if (file.isDirectory()) {
 		conflicts.removeAll(removed);
 	}
 
-	void processEntry(TreeEntry h, TreeEntry m, Entry i,
-			File file) throws IOException {
+	void processEntry(TreeEntry h, TreeEntry m, Entry i) throws IOException {
 				ObjectId iId = (i == null ? null : i.getObjectId());
 				ObjectId mId = (m == null ? null : m.getId());
 				ObjectId hId = (h == null ? null : h.getId());
-- 
1.6.1.285.g35d8b
Previous: Robin RosenbergNext: Robin Rosenberg
Message 10 of 15 in “JGit cleanups”
  1. 00/10 JGit cleanupsRobin Rosenberg, Mar 16, 2009
  2. 01/10 Require javadoc on protected methods in jgit coreRobin Rosenberg, Mar 16, 2009
  3. 02/10 Rename the objectsUrl in the nested HttpObjectDB toRobin Rosenberg, Mar 16, 2009
  4. 03/10 Rename variables that hides others with different content in FetchProcessRobin Rosenberg, Mar 16, 2009
  5. 04/10 Rename a parameter i PackWriter that hides another with the same nameRobin Rosenberg, Mar 16, 2009
  6. 05/10 Rename fields to avoid hiding of field names in ReadTreeTestRobin Rosenberg, Mar 16, 2009
  7. 06/10 Rename the gitDir fields to indicate they refer to another dir than the defaultRobin Rosenberg, Mar 16, 2009
  8. 07/10 Rename a parameter in PushProcessTest that hides anotherRobin Rosenberg, Mar 16, 2009
  9. 08/10 Drop unused end parameters in hunk parsing codeRobin Rosenberg, Mar 16, 2009
  10. 09/10 Drop unused File arguments in IndexTreeWalker and WorkdirCheckoutRobin Rosenberg, Mar 16, 2009
  11. 10/10 Drop an effectively unused parameter in IndexTreeWalker.Robin Rosenberg, Mar 16, 2009
  12. Shawn O. PearceMar 16, 2009
  13. Shawn O. PearceMar 16, 2009
  14. Robin RosenbergMar 16, 2009
  15. Shawn O. PearceMar 16, 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.