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

View file

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View file

@ -4,7 +4,6 @@
xmlns:vm="using:SourceGit.ViewModels" xmlns:vm="using:SourceGit.ViewModels"
xmlns:c="using:SourceGit.Converters" xmlns:c="using:SourceGit.Converters"
xmlns:ae="using:AvaloniaEdit" xmlns:ae="using:AvaloniaEdit"
xmlns:aee="using:AvaloniaEdit.Editing"
xmlns:aes="using:AvaloniaEdit.Search"> xmlns:aes="using:AvaloniaEdit.Search">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
@ -581,19 +580,6 @@
</Style> </Style>
</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"> <Style Selector="aes|SearchPanel">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="aes:SearchPanel"> <ControlTemplate TargetType="aes:SearchPanel">

View file

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

View file

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

View file

@ -15,7 +15,7 @@ namespace SourceGit.Views
{ {
public partial class CommitMessagePresenter : SelectableTextBlock 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(); private static partial Regex REG_SHA_FORMAT();
public static readonly StyledProperty<string> MessageProperty = public static readonly StyledProperty<string> MessageProperty =

View file

@ -125,7 +125,7 @@
</Button> </Button>
</Grid> </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"> <ScrollViewer MaxHeight="200" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBlock Margin="4,2" TextWrapping="NoWrap" Text="{Binding Message}"/> <TextBlock Margin="4,2" TextWrapping="NoWrap" Text="{Binding Message}"/>
</ScrollViewer> </ScrollViewer>