Compare commits

..

No commits in common. "7526def44839a93deec231f4a574256a74d400d1" and "1c345df37db53e416d98887d860c919ef8c8311e" have entirely different histories.

8 changed files with 11 additions and 38 deletions

View file

@ -35,7 +35,7 @@ namespace SourceGit.Models
private static AvatarManager _instance = null;
[GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@.+\.github\.com$")]
[GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@users\.noreply\.github\.com$")]
private static partial Regex REG_GITHUB_USER_EMAIL();
private object _synclock = new object();
@ -43,7 +43,6 @@ namespace SourceGit.Models
private List<IAvatarHost> _avatars = new List<IAvatarHost>();
private Dictionary<string, Bitmap> _resources = new Dictionary<string, Bitmap>();
private HashSet<string> _requesting = new HashSet<string>();
private HashSet<string> _defaultAvatars = new HashSet<string>();
public void Start()
{
@ -51,8 +50,8 @@ namespace SourceGit.Models
if (!Directory.Exists(_storePath))
Directory.CreateDirectory(_storePath);
LoadDefaultAvatar("noreply@github.com", "github.png");
LoadDefaultAvatar("unrealbot@epicgames.com", "unreal.png");
var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/Images/github.png", UriKind.RelativeOrAbsolute));
_resources.Add("noreply@github.com", new Bitmap(icon));
Task.Run(() =>
{
@ -141,7 +140,7 @@ namespace SourceGit.Models
{
if (forceRefetch)
{
if (_defaultAvatars.Contains(email))
if (email.Equals("noreply@github.com", StringComparison.Ordinal))
return null;
if (_resources.ContainsKey(email))
@ -186,13 +185,6 @@ namespace SourceGit.Models
return null;
}
private void LoadDefaultAvatar(string key, string img)
{
var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/Images/{img}", UriKind.RelativeOrAbsolute));
_resources.Add(key, new Bitmap(icon));
_defaultAvatars.Add(key);
}
private string GetEmailHash(string email)
{
var lowered = email.ToLower(CultureInfo.CurrentCulture).Trim();

View file

@ -26,12 +26,6 @@ namespace SourceGit.Models
set;
} = false;
public bool EnableForceOnFetch
{
get;
set;
} = false;
public bool FetchWithoutTags
{
get;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View file

@ -4,7 +4,6 @@
xmlns:vm="using:SourceGit.ViewModels"
xmlns:c="using:SourceGit.Converters"
xmlns:ae="using:AvaloniaEdit"
xmlns:aee="using:AvaloniaEdit.Editing"
xmlns:aes="using:AvaloniaEdit.Search">
<Design.PreviewWith>
<StackPanel Orientation="Vertical">
@ -581,19 +580,6 @@
</Style>
</Style>
<Style Selector="aee|TextArea">
<Setter Property="SelectionBorder">
<Setter.Value>
<Pen Brush="{DynamicResource SystemAccentColor}" Thickness="1" />
</Setter.Value>
</Setter>
<Setter Property="SelectionBrush">
<Setter.Value>
<SolidColorBrush Opacity="0.5" Color="{DynamicResource SystemAccentColor}" />
</Setter.Value>
</Setter>
</Style>
<Style Selector="aes|SearchPanel">
<Setter Property="Template">
<ControlTemplate TargetType="aes:SearchPanel">

View file

@ -20,7 +20,7 @@
<RepositoryType>Public</RepositoryType>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableAOT)' != 'true'">
<PropertyGroup Condition="'$(Configuration)' == 'Release' and '$(SourceGitNoAot)' != 'true'">
<PublishAot>true</PublishAot>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>link</TrimMode>

View file

@ -30,14 +30,15 @@ namespace SourceGit.ViewModels
public bool Force
{
get => _repo.Settings.EnableForceOnFetch;
set => _repo.Settings.EnableForceOnFetch = value;
get;
set;
}
public Fetch(Repository repo, Models.Remote preferedRemote = null)
{
_repo = repo;
_fetchAllRemotes = preferedRemote == null;
Force = false;
SelectedRemote = preferedRemote != null ? preferedRemote : _repo.Remotes[0];
View = new Views.Fetch() { DataContext = this };
}
@ -48,7 +49,7 @@ namespace SourceGit.ViewModels
var notags = _repo.Settings.FetchWithoutTags;
var prune = _repo.Settings.EnablePruneOnFetch;
var force = _repo.Settings.EnableForceOnFetch;
var force = Force;
return Task.Run(() =>
{
if (FetchAllRemotes)

View file

@ -15,7 +15,7 @@ namespace SourceGit.Views
{
public partial class CommitMessagePresenter : SelectableTextBlock
{
[GeneratedRegex(@"\b([0-9a-fA-F]{10,40})\b")]
[GeneratedRegex(@"\b([0-9a-fA-F]{8,40})\b")]
private static partial Regex REG_SHA_FORMAT();
public static readonly StyledProperty<string> MessageProperty =

View file

@ -125,7 +125,7 @@
</Button>
</Grid>
<Border Grid.Row="1" Margin="8" Background="Transparent">
<Border Grid.Row="1" Margin="8" Background="{DynamicResource Brush.Contents}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
<ScrollViewer MaxHeight="200" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBlock Margin="4,2" TextWrapping="NoWrap" Text="{Binding Message}"/>
</ScrollViewer>