Updated to newer version of jGit

JGit version 0.8.4.43-g3fd4918 has support for doing whitespace
ignore during diffs. The new version abstracted out the file system
in many of its file accessing methods, and so the code in Gerrit
that called those methods needed to be updated to pass along
FS.DETECTED.

Whitespace skipping support in jGit was necessary, since we are now
using jGit to perform file diffing. The options we were passing
along to git diff to perform those duties were not present in the
prior version of jGit (0.7.1.74-g16419da).

Change-Id: I8cf78e929831319da07ef08cd2a129ec3e9f7ef9
Change-Id: I24103a072a649577b50f5432f3c4b2df469f6494
(cherry picked from commit 9669dbf8ae)
This commit is contained in:
Jeff Schumacher
2010-06-28 17:56:12 -07:00
committed by Shawn O. Pearce
parent 7de7341baa
commit 6823b01a65
4 changed files with 10 additions and 7 deletions

View File

@@ -22,6 +22,7 @@ import com.google.gwtorm.client.SchemaFactory;
import com.google.inject.Inject;
import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.eclipse.jgit.util.FS;
import java.io.File;
import java.io.IOException;
@@ -76,7 +77,7 @@ public class GitProjectImporter {
continue;
}
if (FileKey.isGitRepository(f)) {
if (FileKey.isGitRepository(f, FS.DETECTED)) {
if (name.equals(".git")) {
name = prefix.substring(0, prefix.length() - 1);

View File

@@ -29,6 +29,7 @@ import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.lib.WindowCache;
import org.eclipse.jgit.lib.WindowCacheConfig;
import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.IO;
import org.eclipse.jgit.util.RawParseUtils;
import org.slf4j.Logger;
@@ -90,7 +91,7 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
}
try {
final FileKey loc = FileKey.lenient(new File(basePath, name));
final FileKey loc = FileKey.lenient(new File(basePath, name), FS.DETECTED);
return RepositoryCache.open(loc);
} catch (IOException e1) {
final RepositoryNotFoundException e2;
@@ -107,12 +108,12 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
}
try {
File dir = FileKey.resolve(new File(basePath, name));
File dir = FileKey.resolve(new File(basePath, name), FS.DETECTED);
FileKey loc;
if (dir != null) {
// Already exists on disk, use the repository we found.
//
loc = FileKey.exact(dir);
loc = FileKey.exact(dir, FS.DETECTED);
} else {
// It doesn't exist under any of the standard permutations
// of the repository name, so prefer the standard bare name.
@@ -120,7 +121,7 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
if (!name.endsWith(".git")) {
name = name + ".git";
}
loc = FileKey.exact(new File(basePath, name));
loc = FileKey.exact(new File(basePath, name), FS.DETECTED);
}
return RepositoryCache.open(loc, false);
} catch (IOException e1) {

View File

@@ -44,6 +44,7 @@ import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.SshConfigSessionFactory;
import org.eclipse.jgit.transport.SshSessionFactory;
import org.eclipse.jgit.transport.URIish;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.QuotedString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -231,7 +232,7 @@ public class PushReplication implements ReplicationQueue {
try {
sshSession =
sshFactory.getSession(replicateURI.getUser(), replicateURI.getPass(),
replicateURI.getHost(), replicateURI.getPort());
replicateURI.getHost(), replicateURI.getPort(), FS.DETECTED);
sshSession.connect();
Channel channel = sshSession.openChannel("exec");

View File

@@ -46,7 +46,7 @@ limitations under the License.
</issueManagement>
<properties>
<jgitVersion>0.8.4</jgitVersion>
<jgitVersion>0.8.4.43-g3fd4918</jgitVersion>
<gwtormVersion>1.1.4</gwtormVersion>
<gwtjsonrpcVersion>1.2.2</gwtjsonrpcVersion>
<gwtexpuiVersion>1.2.1</gwtexpuiVersion>