diff options
author | silverwind <me@silverwind.io> | 2020-12-09 01:12:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 01:12:15 +0100 |
commit | c05701dd7d72aea75c67fbb07df928c192474686 (patch) | |
tree | 807d295c28ad57950120e0b14596168902efde0d /modules/repository/commits_test.go | |
parent | 658e90a1141a03e5249770a6a670b818fe307e1d (diff) | |
download | gitea-c05701dd7d72aea75c67fbb07df928c192474686.tar.gz gitea-c05701dd7d72aea75c67fbb07df928c192474686.zip |
Fix frontpage avatars (#13853)
The frontpage uses a rather strange method to obtain the commit's avatar
which I've overlooked earlier. I don't exactly understand how it works
but this change fixes the wrong default avatars by using the function
that was in previous use.
Also introduced a few constants for size an size increase factor.
Fixes: https://github.com/go-gitea/gitea/issues/13844
Diffstat (limited to 'modules/repository/commits_test.go')
-rw-r--r-- | modules/repository/commits_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/repository/commits_test.go b/modules/repository/commits_test.go index cb00e19c2e..16677fe8a6 100644 --- a/modules/repository/commits_test.go +++ b/modules/repository/commits_test.go @@ -112,11 +112,13 @@ func TestPushCommits_AvatarLink(t *testing.T) { pushCommits.Len = len(pushCommits.Commits) assert.Equal(t, - "/user/avatar/user2/-1", + "https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon&s=56", pushCommits.AvatarLink("user2@example.com")) assert.Equal(t, - "/avatar/"+fmt.Sprintf("%x", md5.Sum([]byte("nonexistent@example.com"))), + "https://secure.gravatar.com/avatar/"+ + fmt.Sprintf("%x", md5.Sum([]byte("nonexistent@example.com")))+ + "?d=identicon&s=56", pushCommits.AvatarLink("nonexistent@example.com")) } |