Skip to content

Commit 1d8cda4

Browse files
committed
Move to .NET 6.0 and upgrade dependencies.
Also adds some extra conflict resolution to the program. Repos overwrite one another in the order that they are given, so the first repo is the most important etc.
1 parent b2febcc commit 1d8cda4

17 files changed

+220
-241
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,4 @@ UpgradeLog*.htm
184184

185185
# Microsoft Fakes
186186
FakesAssemblies/
187+
.vs

Mpdeimos.GitRepoZipper.sln

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31919.166
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mpdeimos.GitRepoZipper", "src\Mpdeimos.GitRepoZipper.csproj", "{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}"
57
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mpdeimos.GitRepoZipper_Test", "test-src\Mpdeimos.GitRepoZipper_Test.csproj", "{CD6489F9-7F08-4926-AEAD-E5204B20A316}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mpdeimos.GitRepoZipper.Tests", "test-src\Mpdeimos.GitRepoZipper.Tests.csproj", "{5E53040F-3A1D-4B74-8653-AB3CF0EC5B39}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|x86 = Debug|x86
11-
Release|x86 = Release|x86
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Debug|x86.ActiveCfg = Debug|x86
15-
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Debug|x86.Build.0 = Debug|x86
16-
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Release|x86.ActiveCfg = Release|x86
17-
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Release|x86.Build.0 = Release|x86
18-
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Debug|x86.ActiveCfg = Debug|x86
19-
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Debug|x86.Build.0 = Debug|x86
20-
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Release|x86.ActiveCfg = Release|x86
21-
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Release|x86.Build.0 = Release|x86
16+
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{4520C23F-BF0A-4045-BC2E-4D3F720EB1BC}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Debug|Any CPU.ActiveCfg = Debug|x86
21+
{CD6489F9-7F08-4926-AEAD-E5204B20A316}.Release|Any CPU.ActiveCfg = Release|x86
22+
{5E53040F-3A1D-4B74-8653-AB3CF0EC5B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{5E53040F-3A1D-4B74-8653-AB3CF0EC5B39}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{5E53040F-3A1D-4B74-8653-AB3CF0EC5B39}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{5E53040F-3A1D-4B74-8653-AB3CF0EC5B39}.Release|Any CPU.Build.0 = Release|Any CPU
26+
EndGlobalSection
27+
GlobalSection(SolutionProperties) = preSolution
28+
HideSolutionNode = FALSE
29+
EndGlobalSection
30+
GlobalSection(ExtensibilityGlobals) = postSolution
31+
SolutionGuid = {B79071DE-0390-4360-8846-6FEB45D27C49}
2232
EndGlobalSection
2333
GlobalSection(MonoDevelopProperties) = preSolution
2434
Policies = $0
@@ -62,21 +72,19 @@ Global
6272
$4.IncludeInNewFiles = True
6373
$0.NameConventionPolicy = $5
6474
$5.Rules = $6
65-
$6.NamingRule = $7
75+
$6.NamingRule = $26
6676
$7.Name = Namespaces
6777
$7.AffectedEntity = Namespace
6878
$7.VisibilityMask = VisibilityMask
6979
$7.NamingStyle = PascalCase
7080
$7.IncludeInstanceMembers = True
7181
$7.IncludeStaticEntities = True
72-
$6.NamingRule = $8
7382
$8.Name = Types
7483
$8.AffectedEntity = Class, Struct, Enum, Delegate
7584
$8.VisibilityMask = Public
7685
$8.NamingStyle = PascalCase
7786
$8.IncludeInstanceMembers = True
7887
$8.IncludeStaticEntities = True
79-
$6.NamingRule = $9
8088
$9.Name = Interfaces
8189
$9.RequiredPrefixes = $10
8290
$10.String = I
@@ -85,7 +93,6 @@ Global
8593
$9.NamingStyle = PascalCase
8694
$9.IncludeInstanceMembers = True
8795
$9.IncludeStaticEntities = True
88-
$6.NamingRule = $11
8996
$11.Name = Attributes
9097
$11.RequiredSuffixes = $12
9198
$12.String = Attribute
@@ -94,7 +101,6 @@ Global
94101
$11.NamingStyle = PascalCase
95102
$11.IncludeInstanceMembers = True
96103
$11.IncludeStaticEntities = True
97-
$6.NamingRule = $13
98104
$13.Name = Event Arguments
99105
$13.RequiredSuffixes = $14
100106
$14.String = EventArgs
@@ -103,7 +109,6 @@ Global
103109
$13.NamingStyle = PascalCase
104110
$13.IncludeInstanceMembers = True
105111
$13.IncludeStaticEntities = True
106-
$6.NamingRule = $15
107112
$15.Name = Exceptions
108113
$15.RequiredSuffixes = $16
109114
$16.String = Exception
@@ -112,70 +117,60 @@ Global
112117
$15.NamingStyle = PascalCase
113118
$15.IncludeInstanceMembers = True
114119
$15.IncludeStaticEntities = True
115-
$6.NamingRule = $17
116120
$17.Name = Methods
117121
$17.AffectedEntity = Methods
118122
$17.VisibilityMask = Protected, Public
119123
$17.NamingStyle = PascalCase
120124
$17.IncludeInstanceMembers = True
121125
$17.IncludeStaticEntities = True
122-
$6.NamingRule = $18
123126
$18.Name = Static Readonly Fields
124127
$18.AffectedEntity = ReadonlyField
125128
$18.VisibilityMask = Protected, Public
126129
$18.NamingStyle = PascalCase
127130
$18.IncludeInstanceMembers = False
128131
$18.IncludeStaticEntities = True
129-
$6.NamingRule = $19
130132
$19.Name = Fields
131133
$19.AffectedEntity = Field
132134
$19.VisibilityMask = Protected, Public
133135
$19.NamingStyle = PascalCase
134136
$19.IncludeInstanceMembers = True
135137
$19.IncludeStaticEntities = True
136-
$6.NamingRule = $20
137138
$20.Name = ReadOnly Fields
138139
$20.AffectedEntity = ReadonlyField
139140
$20.VisibilityMask = Protected, Public
140141
$20.NamingStyle = PascalCase
141142
$20.IncludeInstanceMembers = True
142143
$20.IncludeStaticEntities = False
143-
$6.NamingRule = $21
144144
$21.Name = Constant Fields
145145
$21.AffectedEntity = ConstantField
146146
$21.VisibilityMask = Protected, Public
147147
$21.NamingStyle = PascalCase
148148
$21.IncludeInstanceMembers = True
149149
$21.IncludeStaticEntities = True
150-
$6.NamingRule = $22
151150
$22.Name = Properties
152151
$22.AffectedEntity = Property
153152
$22.VisibilityMask = Protected, Public
154153
$22.NamingStyle = PascalCase
155154
$22.IncludeInstanceMembers = True
156155
$22.IncludeStaticEntities = True
157-
$6.NamingRule = $23
158156
$23.Name = Events
159157
$23.AffectedEntity = Event
160158
$23.VisibilityMask = Protected, Public
161159
$23.NamingStyle = PascalCase
162160
$23.IncludeInstanceMembers = True
163161
$23.IncludeStaticEntities = True
164-
$6.NamingRule = $24
165162
$24.Name = Enum Members
166163
$24.AffectedEntity = EnumMember
167164
$24.VisibilityMask = VisibilityMask
168165
$24.NamingStyle = PascalCase
169166
$24.IncludeInstanceMembers = True
170167
$24.IncludeStaticEntities = True
171-
$6.NamingRule = $25
172168
$25.Name = Parameters
173169
$25.AffectedEntity = Parameter
174170
$25.VisibilityMask = VisibilityMask
175171
$25.NamingStyle = CamelCase
176172
$25.IncludeInstanceMembers = True
177173
$25.IncludeStaticEntities = True
178-
$6.NamingRule = $26
179174
$26.Name = Type Parameters
180175
$26.RequiredPrefixes = $27
181176
$27.String = T

src/Main.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Model/Config.cs

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,38 @@ public class Config
1313
[Option('o', "output", Required = true, HelpText = "The output repository to write to.")]
1414
public string Target { get; set; }
1515

16-
[OptionArray('i', "input", HelpText = "The input repositories to read from.")]
17-
public string[] Sources { get; set; }
16+
[Option('i', "input", HelpText = "The input repositories to read from.")]
17+
public IEnumerable<string> Sources { get; set; }
1818

19-
[OptionArray('b', "include", HelpText = "The branches to include (by friendly name, regex).")]
20-
public string[] Include { get; set; }
19+
[Option('b', "include", HelpText = "The branches to include (by friendly name, regex).")]
20+
public IEnumerable<string> Include { get; set; }
2121

22-
[OptionArray('x', "exclude", HelpText = "The branches to exclude (by friendly name, regex).")]
23-
public string[] Exclude { get; set; }
22+
[Option('x', "exclude", HelpText = "The branches to exclude (by friendly name, regex).")]
23+
public IEnumerable<string> Exclude { get; set; }
2424

25-
[Option("remote", HelpText = "Include remote branches.", DefaultValue = false)]
25+
[Option("remote", HelpText = "Include remote branches.", Default = false)]
2626
public bool Remote { get; set; }
2727

28-
[Option('g', "graft-merges", HelpText = "Graft merges instead of rewriting the history.", DefaultValue = false)]
28+
[Option('g', "graft-merges", HelpText = "Graft merges instead of rewriting the history.", Default = false)]
2929
public bool GraftMerges { get; set; }
3030

31-
[Option('f', "force", HelpText = "Forces overriding the output repository.", DefaultValue = false)]
31+
[Option('f', "force", HelpText = "Forces overriding the output repository.", Default = false)]
3232
public bool Force { get; set; }
3333

34-
[Option('s', "silent", HelpText = "Prevents printing to proggress information to the console.", DefaultValue = false)]
34+
[Option('s', "silent", HelpText = "Prevents printing to proggress information to the console.", Default = false)]
3535
public bool Silent { get; set; }
3636

37-
[Option('r', "retry", HelpText = "Allows resuming an operation if an error occurrs by manually modifying the workspace.", DefaultValue = false)]
37+
[Option('r', "retry", HelpText = "Allows resuming an operation if an error occurrs by manually modifying the workspace.", Default = false)]
3838
public bool Retry { get; set; }
3939

40-
[Option('n', "dry-run", HelpText = "Dry run of zipping the repositories (does not write anything to the specified output).", DefaultValue = false)]
40+
[Option('n', "dry-run", HelpText = "Dry run of zipping the repositories (does not write anything to the specified output).", Default = false)]
4141
public bool DryRun { get; set; }
4242

43-
/// <summary>
44-
/// The usage help provided from annotated options.
45-
/// </summary>
46-
[HelpOption]
47-
public string GetUsage()
48-
{
49-
return HelpText.AutoBuild(this, current => HelpText.DefaultParsingErrorsHandler(this, current));
50-
}
43+
[Option('k', "keep", HelpText = "Keeps the remotes to the input repositories.", Default = false)]
44+
public bool Keep { get; set; }
5145

52-
/// <summary>
53-
/// Constructor for parsing the commandline.
54-
/// </summary>
55-
public static Config FromCommandline(params string[] args)
56-
{
57-
var config = new Config();
58-
Parser.Default.ParseArgumentsStrict(args, config);
59-
return config;
60-
}
46+
[Option('t', "tags", HelpText = "Keep tags, they might not be correctly rewritten.", Default = false)]
47+
public bool Tags { get; set; }
6148

6249
/// <summary>
6350
/// Returns whether a branch is included by this configuration.

src/Model/DryRepository.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public Configuration Config
176176
}
177177
}
178178

179-
public Index Index
179+
public LibGit2Sharp.Index Index
180180
{
181181
get
182182
{
@@ -287,12 +287,24 @@ public void Dispose()
287287

288288
public BranchCollection Branches { get; } = new DryBranchCollection();
289289

290-
public Branch Checkout(Branch branch, CheckoutOptions options)
290+
public WorktreeCollection Worktrees => throw new NotImplementedException();
291+
292+
public Branch Checkout(Branch branch, CheckoutOptions options)
291293
{
292294
return branch;
293295
}
294296

295-
public class DryBranchCollection : BranchCollection
297+
public void Checkout(Tree tree, IEnumerable<string> paths, CheckoutOptions opts)
298+
{
299+
throw new NotImplementedException();
300+
}
301+
302+
public void RevParse(string revision, out Reference reference, out GitObject obj)
303+
{
304+
throw new NotImplementedException();
305+
}
306+
307+
public class DryBranchCollection : BranchCollection
296308
{
297309
private Dictionary<string, Branch> branches = new Dictionary<string, Branch>();
298310

src/Model/ShallowCommit.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public override int GetHashCode()
4848

4949
public static ShallowCommit FromCommit(Commit commit)
5050
{
51+
if (commit == null)
52+
{
53+
throw new ArgumentNullException(nameof(commit));
54+
}
55+
5156
if (!Cache.ContainsKey(commit.Sha))
5257
{
5358
Cache[commit.Sha] = new ShallowCommit(commit);

0 commit comments

Comments
 (0)