From 2c33c725f93e8b42706aec5e756be228e009bfee Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Fri, 8 Aug 2014 15:04:57 -0700 Subject: [PATCH] ResolveMerger: push result file creation into updateIndex() The only caller of writeMergedFile is updateIndex, and the only user of this path object is the code within the method. This is a no-op change that opens the door to refactoring the way temp files are handled for inCore merges. Change-Id: I863a303194689a806b667e55eb958e1decf046c1 --- .../src/org/eclipse/jgit/merge/ResolveMerger.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 712bb0d35..d18e31aef 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -635,8 +635,7 @@ protected boolean processEntry(CanonicalTreeParser base, MergeResult result = contentMerge(base, ours, theirs); if (ignoreConflicts) result.setContainsConflicts(false); - File of = writeMergedFile(result); - updateIndex(base, ours, theirs, result, of); + updateIndex(base, ours, theirs, result); if (result.containsConflicts() && !ignoreConflicts) unmergedPaths.add(tw.getPathString()); modifiedFiles.add(tw.getPathString()); @@ -750,14 +749,14 @@ private boolean isWorktreeDirty(WorkingTreeIterator work, * @param ours * @param theirs * @param result - * @param of * @throws FileNotFoundException * @throws IOException */ private void updateIndex(CanonicalTreeParser base, CanonicalTreeParser ours, CanonicalTreeParser theirs, - MergeResult result, File of) throws FileNotFoundException, + MergeResult result) throws FileNotFoundException, IOException { + File of = writeMergedFile(result); if (result.containsConflicts()) { // a conflict occurred, the file will contain conflict markers // the index will be populated with the three stages and only the