Browse Source

Merge "Use object id provided by working tree iterator for submodules"

stable-2.0
Shawn Pearce 13 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
95ceb24866
  1. 20
      org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java

20
org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java

@ -43,7 +43,6 @@
*/
package org.eclipse.jgit.api;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
@ -59,7 +58,6 @@ import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.dircache.DirCacheIterator;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.treewalk.FileTreeIterator;
@ -185,20 +183,10 @@ public class AddCommand extends GitCommand<DirCache> {
} finally {
in.close();
}
builder.add(entry);
lastAddedFile = path;
} else {
Repository subRepo = Git.open(
new File(repo.getWorkTree(), path))
.getRepository();
ObjectId subRepoHead = subRepo
.resolve(Constants.HEAD);
if (subRepoHead != null) {
entry.setObjectId(subRepoHead);
builder.add(entry);
lastAddedFile = path;
}
}
} else
entry.setObjectId(f.getEntryObjectId());
builder.add(entry);
lastAddedFile = path;
} else {
builder.add(c.getDirCacheEntry());
}

Loading…
Cancel
Save