diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-04-16 00:05:41 +0200 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2013-04-18 15:33:50 -0500 |
commit | 526b6266a5afa1de67a1667230fc4ebea331dab5 (patch) | |
tree | 6fc9562072694ee57a62b33336486f575fac1ad0 /org.eclipse.jgit.pgm/src/org | |
parent | 6e90671a51eb91f4c53263e4169e736da6476ba2 (diff) | |
download | jgit-526b6266a5afa1de67a1667230fc4ebea331dab5.tar.gz jgit-526b6266a5afa1de67a1667230fc4ebea331dab5.zip |
Remove some unnecessary dependencies on FileRepostory
Change-Id: Ib6ee3a2874a7e2240aa68f4ac32d00c4d1fab5ae
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
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) |