Skip to content
Browse files

Started adding a quick-clone command that doesn't pull in history.

  • Loading branch information...
1 parent 0cd569d commit 15601be8d7f4cd4f8fcceb40e63d41390193b6ef Matt Burke committed Jun 17, 2010
Showing with 39 additions and 2 deletions.
  1. +1 −1 GitTfs/Commands/Clone.cs
  2. +36 −0 GitTfs/Commands/QuickClone.cs
  3. +1 −0 GitTfs/GitTfs.csproj
  4. +1 −1 test-git-tfs.sh
View
2 GitTfs/Commands/Clone.cs
@@ -36,7 +36,7 @@ public int Run(IList<string> args)
return retVal;
}
- private IList<string> DeriveRepositoryDirectory(IList<string> args)
+ internal static IList<string> DeriveRepositoryDirectory(IList<string> args)
{
if (args.Count == 2)
{
View
36 GitTfs/Commands/QuickClone.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using CommandLine.OptParse;
+using StructureMap;
+
+namespace Sep.Git.Tfs.Commands
+{
+ [Pluggable("quick-clone")]
+ [Description("quick-clone [options] tfs-url repository-path <git-repository-path>")]
+ public class QuickClone : GitTfsCommand
+ {
+ private readonly Globals _globals;
+ private readonly Init _init;
+
+ public QuickClone(Globals globals, Init init)
+ {
+ _globals = globals;
+ _init = init;
+ }
+
+ public IEnumerable<IOptionResults> ExtraOptions
+ {
+ get { return this.MakeNestedOptionResults(_init); }
+ }
+
+ public int Run(IList<string> args)
+ {
+ var retVal = 0;
+ retVal = _init.Run(Clone.DeriveRepositoryDirectory(args));
+ //if (retVal == 0) retVal = fetch.Run(new List<string>());
+ if (retVal == 0) _globals.Repository.CommandNoisy("merge", _globals.Repository.ReadAllTfsRemotes().First().RemoteRef);
+ return retVal;
+ }
+ }
+}
View
1 GitTfs/GitTfs.csproj
@@ -72,6 +72,7 @@
<Compile Include="Commands\Init.cs" />
<Compile Include="Commands\InitOptions.cs" />
<Compile Include="Commands\Pull.cs" />
+ <Compile Include="Commands\QuickClone.cs" />
<Compile Include="Commands\RemoteOptions.cs" />
<Compile Include="Commands\Shelve.cs" />
<Compile Include="Core\Changes\Git\Add.cs" />
View
2 test-git-tfs.sh
@@ -1,7 +1,7 @@
#!/bin/sh -x
rm -rf smoke-test || exit
-time git tfs clone http://team:8080 $/sandbox smoke-test || exit
+time git tfs quick-clone http://team:8080 $/sandbox smoke-test || exit
cd smoke-test || exit
git tfs fetch || exit
git log --oneline --shortstat | cat

0 comments on commit 15601be

Please sign in to comment.
Something went wrong with that request. Please try again.