forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Deduplicate lfs common code (go-gitea#30704) Improve job commit description (go-gitea#30579) Improve test for TestPullCompare (go-gitea#30699) Allow to save empty comment (go-gitea#30706) [skip ci] Updated translations via Crowdin Refactor imagediff and fix regression bug (go-gitea#30694) Improve oauth2 client "preferred username field" logic and the error handling (go-gitea#30622) Fix active item in tab menu (go-gitea#30690)
- Loading branch information
Showing
29 changed files
with
403 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package pipeline | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"code.gitea.io/gitea/modules/git" | ||
) | ||
|
||
// LFSResult represents commits found using a provided pointer file hash | ||
type LFSResult struct { | ||
Name string | ||
SHA string | ||
Summary string | ||
When time.Time | ||
ParentHashes []git.ObjectID | ||
BranchName string | ||
FullCommitName string | ||
} | ||
|
||
type lfsResultSlice []*LFSResult | ||
|
||
func (a lfsResultSlice) Len() int { return len(a) } | ||
func (a lfsResultSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | ||
func (a lfsResultSlice) Less(i, j int) bool { return a[j].When.After(a[i].When) } | ||
|
||
func lfsError(msg string, err error) error { | ||
return fmt.Errorf("LFS error occurred, %s: err: %w", msg, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package session | ||
|
||
import ( | ||
"net/http" | ||
|
||
"gitea.com/go-chi/session" | ||
) | ||
|
||
type MockStore struct { | ||
*session.MemStore | ||
} | ||
|
||
func (m *MockStore) Destroy(writer http.ResponseWriter, request *http.Request) error { | ||
return nil | ||
} | ||
|
||
type mockStoreContextKeyStruct struct{} | ||
|
||
var MockStoreContextKey = mockStoreContextKeyStruct{} | ||
|
||
func NewMockStore(sid string) *MockStore { | ||
return &MockStore{session.NewMemStore(sid)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.