mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
refactor!: remove go-git backend (#39487)
Removes the go-git backend so every build uses the git CLI backend. Its Windows performance advantage is gone, it lacks SHA-256 support, and it breaks repositories on Windows. The performance changes moved to https://github.com/go-gitea/gitea/pull/39526. Fixes https://github.com/go-gitea/gitea/issues/38359 Fixes https://github.com/go-gitea/gitea/issues/34694 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
3932624947
commit
ad38b60983
69 files changed
+995
-2741
No files matched your search
@@ -5,11 +5,14 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
// Helper to get a signature from the commit line, which looks like:
|
||||
@@ -47,3 +50,25 @@ func parseSignatureFromCommitLine(line string) *Signature {
|
||||
}
|
||||
return sig
|
||||
}
|
||||
|
||||
// Signature represents the Author, Committer or Tagger information.
|
||||
type Signature struct {
|
||||
Name string // the committer name, it can be anything
|
||||
Email string // the committer email, it can be anything
|
||||
When time.Time // the timestamp of the signature
|
||||
}
|
||||
|
||||
func (s *Signature) String() string {
|
||||
return fmt.Sprintf("%s <%s>", s.Name, s.Email)
|
||||
}
|
||||
|
||||
// Encode writes the signature for git commit object
|
||||
func (s *Signature) Encode(w io.Writer) error {
|
||||
_, err := fmt.Fprintf(w, "%s <%s> %d %s", s.Name, s.Email, max(0, s.When.Unix()), s.When.Format("-0700"))
|
||||
return err
|
||||
}
|
||||
|
||||
// Decode parses the signature for git commit object
|
||||
func (s *Signature) Decode(b []byte) {
|
||||
*s = *parseSignatureFromCommitLine(util.UnsafeBytesToString(b))
|
||||
}
|
||||
Reference in new issue
Block a user