Skip to content

Commit af888e1

Browse files
committed
Merge branch 'release/v8.33'
2 parents 6099d54 + 6ccdf47 commit af888e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+428
-243
lines changed

SourceGit.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_common", "_common", "{04FD
4141
EndProject
4242
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "usr", "usr", "{76639799-54BC-45E8-BD90-F45F63ACD11D}"
4343
EndProject
44-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bin", "bin", "{2E27E952-846B-4D75-A426-D22151277864}"
45-
ProjectSection(SolutionItems) = preProject
46-
build\resources\_common\usr\bin\sourcegit = build\resources\_common\usr\bin\sourcegit
47-
EndProjectSection
48-
EndProject
4944
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "share", "share", "{A3ABAA7C-EE14-4448-B466-6E69C1347E7D}"
5045
EndProject
5146
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{2AF28D3B-14A8-46A8-B828-157FAAB1B06F}"
@@ -106,7 +101,6 @@ Global
106101
{ABC98884-F023-4EF4-A9C9-5DE9452BE955} = {FD384607-ED99-47B7-AF31-FB245841BC92}
107102
{04FD74B1-FBDB-496E-A48F-3D59D71FF952} = {FD384607-ED99-47B7-AF31-FB245841BC92}
108103
{76639799-54BC-45E8-BD90-F45F63ACD11D} = {04FD74B1-FBDB-496E-A48F-3D59D71FF952}
109-
{2E27E952-846B-4D75-A426-D22151277864} = {76639799-54BC-45E8-BD90-F45F63ACD11D}
110104
{A3ABAA7C-EE14-4448-B466-6E69C1347E7D} = {76639799-54BC-45E8-BD90-F45F63ACD11D}
111105
{2AF28D3B-14A8-46A8-B828-157FAAB1B06F} = {A3ABAA7C-EE14-4448-B466-6E69C1347E7D}
112106
{7166EC6C-17F5-4B5E-B38E-1E53C81EACF6} = {A3ABAA7C-EE14-4448-B466-6E69C1347E7D}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.32
1+
8.33

src/Commands/Checkout.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public Checkout(string repo)
1414

1515
public bool Branch(string branch, Action<string> onProgress)
1616
{
17-
Args = $"checkout --progress {branch}";
17+
Args = $"checkout --recurse-submodules --progress {branch}";
1818
TraitErrorAsOutput = true;
1919
_outputHandler = onProgress;
2020
return Exec();
2121
}
2222

2323
public bool Branch(string branch, string basedOn, Action<string> onProgress)
2424
{
25-
Args = $"checkout --progress -b {branch} {basedOn}";
25+
Args = $"checkout --recurse-submodules --progress -b {branch} {basedOn}";
2626
TraitErrorAsOutput = true;
2727
_outputHandler = onProgress;
2828
return Exec();
2929
}
3030

3131
public bool UseTheirs(List<string> files)
3232
{
33-
StringBuilder builder = new StringBuilder();
33+
var builder = new StringBuilder();
3434
builder.Append("checkout --theirs --");
3535
foreach (var f in files)
3636
{
@@ -44,7 +44,7 @@ public bool UseTheirs(List<string> files)
4444

4545
public bool UseMine(List<string> files)
4646
{
47-
StringBuilder builder = new StringBuilder();
47+
var builder = new StringBuilder();
4848
builder.Append("checkout --ours --");
4949
foreach (var f in files)
5050
{
@@ -70,20 +70,6 @@ public bool Commit(string commitId, Action<string> onProgress)
7070
return Exec();
7171
}
7272

73-
public bool Files(List<string> files)
74-
{
75-
StringBuilder builder = new StringBuilder();
76-
builder.Append("checkout -f -q --");
77-
foreach (var f in files)
78-
{
79-
builder.Append(" \"");
80-
builder.Append(f);
81-
builder.Append("\"");
82-
}
83-
Args = builder.ToString();
84-
return Exec();
85-
}
86-
8773
protected override void OnReadline(string line)
8874
{
8975
_outputHandler?.Invoke(line);

src/Commands/Clean.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ namespace SourceGit.Commands
55
{
66
public class Clean : Command
77
{
8-
public Clean(string repo)
8+
public Clean(string repo, bool includeIgnored)
99
{
1010
WorkingDirectory = repo;
1111
Context = repo;
12-
Args = "clean -qfd";
12+
Args = includeIgnored ? "clean -qfdx" : "clean -qfd";
1313
}
1414

1515
public Clean(string repo, List<string> files)
1616
{
17-
StringBuilder builder = new StringBuilder();
17+
var builder = new StringBuilder();
1818
builder.Append("clean -qfd --");
1919
foreach (var f in files)
2020
{

src/Commands/Diff.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public partial class Diff : Command
1212
private const string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/";
1313
private const string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/";
1414

15-
public Diff(string repo, Models.DiffOption opt, int unified)
15+
public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespace)
1616
{
1717
_result.TextDiff = new Models.TextDiff()
1818
{
@@ -22,7 +22,11 @@ public Diff(string repo, Models.DiffOption opt, int unified)
2222

2323
WorkingDirectory = repo;
2424
Context = repo;
25-
Args = $"diff --ignore-cr-at-eol --unified={unified} {opt}";
25+
26+
if (ignoreWhitespace)
27+
Args = $"diff --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}";
28+
else
29+
Args = $"diff --ignore-cr-at-eol --unified={unified} {opt}";
2630
}
2731

2832
public Models.DiffResult Result()

src/Commands/Discard.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace SourceGit.Commands
55
{
66
public static class Discard
77
{
8-
public static void All(string repo)
8+
public static void All(string repo, bool includeIgnored)
99
{
1010
new Restore(repo).Exec();
11-
new Clean(repo).Exec();
11+
new Clean(repo, includeIgnored).Exec();
1212
}
1313

1414
public static void Changes(string repo, List<Models.Change> changes)

src/Commands/Stash.cs

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,45 @@ public bool Push(string message)
1717
return Exec();
1818
}
1919

20-
public bool Push(List<Models.Change> changes, string message)
20+
public bool Push(List<Models.Change> changes, string message, bool onlyStaged)
2121
{
2222
var pathsBuilder = new StringBuilder();
23-
var needAdd = new List<Models.Change>();
24-
foreach (var c in changes)
25-
{
26-
pathsBuilder.Append($"\"{c.Path}\" ");
2723

28-
if (c.WorkTree == Models.ChangeState.Added || c.WorkTree == Models.ChangeState.Untracked)
24+
if (onlyStaged)
25+
{
26+
foreach (var c in changes)
27+
pathsBuilder.Append($"\"{c.Path}\" ");
28+
29+
var paths = pathsBuilder.ToString();
30+
Args = $"stash push --staged -m \"{message}\" -- {paths}";
31+
}
32+
else
33+
{
34+
var needAdd = new List<Models.Change>();
35+
foreach (var c in changes)
2936
{
30-
needAdd.Add(c);
31-
if (needAdd.Count > 10)
37+
pathsBuilder.Append($"\"{c.Path}\" ");
38+
39+
if (c.WorkTree == Models.ChangeState.Added || c.WorkTree == Models.ChangeState.Untracked)
3240
{
33-
new Add(WorkingDirectory, needAdd).Exec();
34-
needAdd.Clear();
41+
needAdd.Add(c);
42+
if (needAdd.Count > 10)
43+
{
44+
new Add(WorkingDirectory, needAdd).Exec();
45+
needAdd.Clear();
46+
}
3547
}
3648
}
49+
if (needAdd.Count > 0)
50+
{
51+
new Add(WorkingDirectory, needAdd).Exec();
52+
needAdd.Clear();
53+
}
54+
55+
var paths = pathsBuilder.ToString();
56+
Args = $"stash push -m \"{message}\" -- {paths}";
3757
}
38-
if (needAdd.Count > 0)
39-
{
40-
new Add(WorkingDirectory, needAdd).Exec();
41-
needAdd.Clear();
42-
}
43-
44-
var paths = pathsBuilder.ToString();
45-
Args = $"stash push -m \"{message}\" -- {paths}";
58+
4659
return Exec();
4760
}
4861

src/Converters/ChangeViewModeConverters.cs

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

src/Models/MergeMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class MergeMode
77
new MergeMode("Default", "Fast-forward if possible", ""),
88
new MergeMode("No Fast-forward", "Always create a merge commit", "--no-ff"),
99
new MergeMode("Squash", "Use '--squash'", "--squash"),
10-
new MergeMode("Don't commit", "Merge without commit", "--no-commit"),
10+
new MergeMode("Don't commit", "Merge without commit", "--no-ff --no-commit"),
1111
];
1212

1313
public string Name { get; set; }

src/Models/RepositorySettings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ namespace SourceGit.Models
44
{
55
public class RepositorySettings
66
{
7+
public string DefaultRemote
8+
{
9+
get;
10+
set;
11+
} = string.Empty;
12+
713
public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch
814
{
915
get;

0 commit comments

Comments
 (0)