diff options
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java index 81ea387ddf..1ec3888177 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java @@ -52,14 +52,15 @@ import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheCheckout; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.lib.TextProgressMonitor; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; -import org.eclipse.jgit.storage.file.FileBasedConfig; +import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import org.eclipse.jgit.transport.FetchResult; import org.eclipse.jgit.transport.RefSpec; import org.eclipse.jgit.transport.RemoteConfig; @@ -83,7 +84,7 @@ class Clone extends AbstractFetchCommand { @Argument(index = 1, metaVar = "metaVar_directory") private String localName; - private FileRepository dst; + private Repository dst; @Override protected final boolean requiresRepository() { @@ -106,9 +107,9 @@ class Clone extends AbstractFetchCommand { if (gitdir == null) gitdir = new File(localName, Constants.DOT_GIT).getAbsolutePath(); - dst = new FileRepository(gitdir); + dst = new FileRepositoryBuilder().setGitDir(new File(gitdir)).build(); dst.create(); - final FileBasedConfig dstcfg = dst.getConfig(); + final StoredConfig dstcfg = dst.getConfig(); dstcfg.setBoolean("core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$ dstcfg.save(); db = dst; @@ -134,7 +135,7 @@ class Clone extends AbstractFetchCommand { private void saveRemote(final URIish uri) throws URISyntaxException, IOException { - final FileBasedConfig dstcfg = dst.getConfig(); + final StoredConfig dstcfg = dst.getConfig(); final RemoteConfig rc = new RemoteConfig(dstcfg, remoteName); rc.addURI(uri); rc.addFetchRefSpec(new RefSpec().setForceUpdate(true) |