mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d81cf34e37 | ||
| 
						 | 
					9902317679 | ||
| 
						 | 
					33e164168f | ||
| 
						 | 
					f40ba68d57 | ||
| 
						 | 
					cb0c8b8ae4 | ||
| 
						 | 
					eba5945d2f | ||
| 
						 | 
					4c67925531 | ||
| 
						 | 
					3c60121ca7 | 
@@ -1,4 +1,11 @@
 | 
			
		||||
# Changelog
 | 
			
		||||
## [1.2.2](https://github.com/go-gitea/gitea/releases/tag/v1.2.2) - 2017-10-26
 | 
			
		||||
* BUGFIXES
 | 
			
		||||
  * Add checks for commits with missing author and time (#2771) (#2785)
 | 
			
		||||
  * Fix sending mail with a non-latin display name (#2559) (#2783)
 | 
			
		||||
  * Sync MaxGitDiffLineCharacters with conf/app.ini (#2779) (#2780)
 | 
			
		||||
  * Update vendor git (#2765) (#2772)
 | 
			
		||||
  * Fix emojify image URL (#2769) (#2773)
 | 
			
		||||
 | 
			
		||||
## [1.2.1](https://github.com/go-gitea/gitea/releases/tag/v1.2.1) - 2017-10-16
 | 
			
		||||
* BUGFIXES
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ func composeIssueCommentMessage(issue *Issue, doer *User, comment *Comment, tplN
 | 
			
		||||
		log.Error(3, "Template: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	msg := mailer.NewMessageFrom(tos, fmt.Sprintf(`"%s" <%s>`, doer.DisplayName(), setting.MailService.FromEmail), subject, content.String())
 | 
			
		||||
	msg := mailer.NewMessageFrom(tos, doer.DisplayName(), setting.MailService.FromEmail, subject, content.String())
 | 
			
		||||
	msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info)
 | 
			
		||||
	return msg
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os/exec"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/git"
 | 
			
		||||
 | 
			
		||||
@@ -119,11 +120,24 @@ func pushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return fmt.Errorf("Commit: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	tagCreatedUnix := commit.Author.When.Unix()
 | 
			
		||||
 | 
			
		||||
	author, err := GetUserByEmail(commit.Author.Email)
 | 
			
		||||
	if err != nil && !IsErrUserNotExist(err) {
 | 
			
		||||
		return fmt.Errorf("GetUserByEmail: %v", err)
 | 
			
		||||
	sig := tag.Tagger
 | 
			
		||||
	if sig == nil {
 | 
			
		||||
		sig = commit.Author
 | 
			
		||||
	}
 | 
			
		||||
	if sig == nil {
 | 
			
		||||
		sig = commit.Committer
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var author *User
 | 
			
		||||
	var createdAt = time.Unix(1, 0)
 | 
			
		||||
 | 
			
		||||
	if sig != nil {
 | 
			
		||||
		author, err = GetUserByEmail(sig.Email)
 | 
			
		||||
		if err != nil && !IsErrUserNotExist(err) {
 | 
			
		||||
			return fmt.Errorf("GetUserByEmail: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
		createdAt = sig.When
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	commitsCount, err := commit.CommitsCount()
 | 
			
		||||
@@ -144,7 +158,8 @@ func pushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string)
 | 
			
		||||
			IsDraft:      false,
 | 
			
		||||
			IsPrerelease: false,
 | 
			
		||||
			IsTag:        true,
 | 
			
		||||
			CreatedUnix:  tagCreatedUnix,
 | 
			
		||||
			Created:      createdAt,
 | 
			
		||||
			CreatedUnix:  createdAt.Unix(),
 | 
			
		||||
		}
 | 
			
		||||
		if author != nil {
 | 
			
		||||
			rel.PublisherID = author.ID
 | 
			
		||||
@@ -155,7 +170,8 @@ func pushUpdateAddTag(repo *Repository, gitRepo *git.Repository, tagName string)
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		rel.Sha1 = commit.ID.String()
 | 
			
		||||
		rel.CreatedUnix = tagCreatedUnix
 | 
			
		||||
		rel.Created = createdAt
 | 
			
		||||
		rel.CreatedUnix = createdAt.Unix()
 | 
			
		||||
		rel.NumCommits = commitsCount
 | 
			
		||||
		rel.IsDraft = false
 | 
			
		||||
		if rel.IsTag && author != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -1205,6 +1205,9 @@ type UserCommit struct {
 | 
			
		||||
 | 
			
		||||
// ValidateCommitWithEmail check if author's e-mail of commit is corresponding to a user.
 | 
			
		||||
func ValidateCommitWithEmail(c *git.Commit) *User {
 | 
			
		||||
	if c.Author == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	u, err := GetUserByEmail(c.Author.Email)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil
 | 
			
		||||
@@ -1223,11 +1226,15 @@ func ValidateCommitsWithEmails(oldCommits *list.List) *list.List {
 | 
			
		||||
	for e != nil {
 | 
			
		||||
		c := e.Value.(*git.Commit)
 | 
			
		||||
 | 
			
		||||
		if v, ok := emails[c.Author.Email]; !ok {
 | 
			
		||||
			u, _ = GetUserByEmail(c.Author.Email)
 | 
			
		||||
			emails[c.Author.Email] = u
 | 
			
		||||
		if c.Author != nil {
 | 
			
		||||
			if v, ok := emails[c.Author.Email]; !ok {
 | 
			
		||||
				u, _ = GetUserByEmail(c.Author.Email)
 | 
			
		||||
				emails[c.Author.Email] = u
 | 
			
		||||
			} else {
 | 
			
		||||
				u = v
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			u = v
 | 
			
		||||
			u = nil
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		newCommits.PushBack(UserCommit{
 | 
			
		||||
 
 | 
			
		||||
@@ -31,11 +31,11 @@ type Message struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewMessageFrom creates new mail message object with custom From header.
 | 
			
		||||
func NewMessageFrom(to []string, from, subject, body string) *Message {
 | 
			
		||||
func NewMessageFrom(to []string, fromDisplayName, fromAddress, subject, body string) *Message {
 | 
			
		||||
	log.Trace("NewMessageFrom (body):\n%s", body)
 | 
			
		||||
 | 
			
		||||
	msg := gomail.NewMessage()
 | 
			
		||||
	msg.SetHeader("From", from)
 | 
			
		||||
	msg.SetAddressHeader("From", fromAddress, fromDisplayName)
 | 
			
		||||
	msg.SetHeader("To", to...)
 | 
			
		||||
	msg.SetHeader("Subject", subject)
 | 
			
		||||
	msg.SetDateHeader("Date", time.Now())
 | 
			
		||||
@@ -58,7 +58,7 @@ func NewMessageFrom(to []string, from, subject, body string) *Message {
 | 
			
		||||
 | 
			
		||||
// NewMessage creates new mail message object with default From header.
 | 
			
		||||
func NewMessage(to []string, subject, body string) *Message {
 | 
			
		||||
	return NewMessageFrom(to, setting.MailService.From, subject, body)
 | 
			
		||||
	return NewMessageFrom(to, setting.MailService.FromName, setting.MailService.FromEmail, subject, body)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type loginAuth struct {
 | 
			
		||||
 
 | 
			
		||||
@@ -432,7 +432,7 @@ var (
 | 
			
		||||
	}{
 | 
			
		||||
		DisableDiffHighlight:     false,
 | 
			
		||||
		MaxGitDiffLines:          1000,
 | 
			
		||||
		MaxGitDiffLineCharacters: 500,
 | 
			
		||||
		MaxGitDiffLineCharacters: 5000,
 | 
			
		||||
		MaxGitDiffFiles:          100,
 | 
			
		||||
		GCArgs:                   []string{},
 | 
			
		||||
		Timeout: struct {
 | 
			
		||||
@@ -1281,6 +1281,7 @@ type Mailer struct {
 | 
			
		||||
	QueueLength     int
 | 
			
		||||
	Name            string
 | 
			
		||||
	From            string
 | 
			
		||||
	FromName        string
 | 
			
		||||
	FromEmail       string
 | 
			
		||||
	SendAsPlainText bool
 | 
			
		||||
 | 
			
		||||
@@ -1339,6 +1340,7 @@ func newMailService() {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Fatal(4, "Invalid mailer.FROM (%s): %v", MailService.From, err)
 | 
			
		||||
	}
 | 
			
		||||
	MailService.FromName = parsed.Name
 | 
			
		||||
	MailService.FromEmail = parsed.Address
 | 
			
		||||
 | 
			
		||||
	log.Info("Mail Service Enabled")
 | 
			
		||||
 
 | 
			
		||||
@@ -1456,7 +1456,7 @@ $(document).ready(function () {
 | 
			
		||||
 | 
			
		||||
    // Emojify
 | 
			
		||||
    emojify.setConfig({
 | 
			
		||||
        img_dir: suburl + '/plugins/emojify/images',
 | 
			
		||||
        img_dir: suburl + '/vendor/plugins/emojify/images',
 | 
			
		||||
        ignore_emoticons: true
 | 
			
		||||
    });
 | 
			
		||||
    var hasEmoji = document.getElementsByClassName('has-emoji');
 | 
			
		||||
 
 | 
			
		||||
@@ -7,12 +7,12 @@ package user
 | 
			
		||||
import (
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/Unknwon/com"
 | 
			
		||||
 | 
			
		||||
	api "code.gitea.io/sdk/gitea"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/modules/context"
 | 
			
		||||
	"code.gitea.io/gitea/modules/markdown"
 | 
			
		||||
	api "code.gitea.io/sdk/gitea"
 | 
			
		||||
 | 
			
		||||
	"github.com/Unknwon/com"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Search search users
 | 
			
		||||
@@ -50,7 +50,7 @@ func Search(ctx *context.APIContext) {
 | 
			
		||||
			ID:        users[i].ID,
 | 
			
		||||
			UserName:  users[i].Name,
 | 
			
		||||
			AvatarURL: users[i].AvatarLink(),
 | 
			
		||||
			FullName:  users[i].FullName,
 | 
			
		||||
			FullName:  markdown.Sanitize(users[i].FullName),
 | 
			
		||||
		}
 | 
			
		||||
		if ctx.IsSigned {
 | 
			
		||||
			results[i].Email = users[i].Email
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,8 @@
 | 
			
		||||
					<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
 | 
			
		||||
					<label>
 | 
			
		||||
						<i class="octicon octicon-git-commit" height="16" width="14"></i>
 | 
			
		||||
						{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" .BranchName | Safe}}
 | 
			
		||||
						{{$branchName := .BranchName | Str2html}}
 | 
			
		||||
						{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}}
 | 
			
		||||
					</label>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
		{{if .Issue.PullRequest.HasMerged}}
 | 
			
		||||
			{{ $mergedStr:= TimeSince .Issue.PullRequest.Merged $.Lang }}
 | 
			
		||||
			<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a>
 | 
			
		||||
			<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span>
 | 
			
		||||
			<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span>
 | 
			
		||||
		{{else}}
 | 
			
		||||
			<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
 | 
			
		||||
			<span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>
 | 
			
		||||
 
 | 
			
		||||
@@ -4,14 +4,16 @@
 | 
			
		||||
			<th class="four wide">
 | 
			
		||||
				{{if .LatestCommitUser}}
 | 
			
		||||
					<img class="ui avatar image img-12" src="{{.LatestCommitUser.RelAvatarLink}}" />
 | 
			
		||||
				  {{if .LatestCommitUser.FullName}}
 | 
			
		||||
					  <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
 | 
			
		||||
				  {{else}}
 | 
			
		||||
				    <a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></a>
 | 
			
		||||
				  {{end}}
 | 
			
		||||
					{{if .LatestCommitUser.FullName}}
 | 
			
		||||
						<a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
 | 
			
		||||
					{{else}}
 | 
			
		||||
						<a href="{{AppSubUrl}}/{{.LatestCommitUser.Name}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
 | 
			
		||||
					{{end}}
 | 
			
		||||
				{{else}}
 | 
			
		||||
					<img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
 | 
			
		||||
					<strong>{{.LatestCommit.Author.Name}}</strong>
 | 
			
		||||
					{{if .LatestCommit.Author}}
 | 
			
		||||
						<img class="ui avatar image img-12" src="{{AvatarLink .LatestCommit.Author.Email}}" />
 | 
			
		||||
						<strong>{{.LatestCommit.Author.Name}}</strong>
 | 
			
		||||
					{{end}}
 | 
			
		||||
				{{end}}
 | 
			
		||||
				<a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified }} isVerified {{end}}{{end}}" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
 | 
			
		||||
						{{ShortSha .LatestCommit.ID.String}}
 | 
			
		||||
@@ -29,7 +31,7 @@
 | 
			
		||||
			</th>
 | 
			
		||||
			<th class="nine wide">
 | 
			
		||||
			</th>
 | 
			
		||||
			<th class="three wide text grey right age">{{TimeSince .LatestCommit.Author.When $.Lang}}</th>
 | 
			
		||||
			<th class="three wide text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
 | 
			
		||||
		</tr>
 | 
			
		||||
	</thead>
 | 
			
		||||
	<tbody>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/code.gitea.io/git/MAINTAINERS
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/code.gitea.io/git/MAINTAINERS
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -15,3 +15,5 @@ Thomas Boerger <thomas@webhippie.de> (@tboerger)
 | 
			
		||||
Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
 | 
			
		||||
Antoine Girard <sapk@sapk.fr> (@sapk)
 | 
			
		||||
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
 | 
			
		||||
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
 | 
			
		||||
Peter Žeby <morlinest@gmail.com> (@morlinest)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								vendor/code.gitea.io/git/commit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/code.gitea.io/git/commit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -12,8 +12,6 @@ import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/mcuadros/go-version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Commit represents a git commit.
 | 
			
		||||
@@ -160,13 +158,7 @@ func CommitChanges(repoPath string, opts CommitChangesOptions) error {
 | 
			
		||||
 | 
			
		||||
func commitsCount(repoPath, revision, relpath string) (int64, error) {
 | 
			
		||||
	var cmd *Command
 | 
			
		||||
	isFallback := false
 | 
			
		||||
	if version.Compare(gitVersion, "1.8.0", "<") {
 | 
			
		||||
		isFallback = true
 | 
			
		||||
		cmd = NewCommand("log", "--pretty=format:''")
 | 
			
		||||
	} else {
 | 
			
		||||
		cmd = NewCommand("rev-list", "--count")
 | 
			
		||||
	}
 | 
			
		||||
	cmd = NewCommand("rev-list", "--count")
 | 
			
		||||
	cmd.AddArguments(revision)
 | 
			
		||||
	if len(relpath) > 0 {
 | 
			
		||||
		cmd.AddArguments("--", relpath)
 | 
			
		||||
@@ -177,9 +169,6 @@ func commitsCount(repoPath, revision, relpath string) (int64, error) {
 | 
			
		||||
		return 0, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if isFallback {
 | 
			
		||||
		return int64(strings.Count(stdout, "\n")) + 1, nil
 | 
			
		||||
	}
 | 
			
		||||
	return strconv.ParseInt(strings.TrimSpace(stdout), 10, 64)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								vendor/code.gitea.io/git/repo_branch.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/code.gitea.io/git/repo_branch.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -7,8 +7,6 @@ package git
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/mcuadros/go-version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// BranchPrefix base dir of the branch information file store on git
 | 
			
		||||
@@ -56,10 +54,6 @@ func (repo *Repository) GetHEADBranch() (*Branch, error) {
 | 
			
		||||
 | 
			
		||||
// SetDefaultBranch sets default branch of repository.
 | 
			
		||||
func (repo *Repository) SetDefaultBranch(name string) error {
 | 
			
		||||
	if version.Compare(gitVersion, "1.7.10", "<") {
 | 
			
		||||
		return ErrUnsupportedVersion{"1.7.10"}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	_, err := NewCommand("symbolic-ref", "HEAD", BranchPrefix+name).RunInDir(repo.Path)
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36
									
								
								vendor/code.gitea.io/git/repo_commit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										36
									
								
								vendor/code.gitea.io/git/repo_commit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -10,8 +10,6 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/mcuadros/go-version"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// getRefCommitID returns the last commit ID string of given reference (branch or tag).
 | 
			
		||||
@@ -248,37 +246,11 @@ func (repo *Repository) FilesCountBetween(startCommitID, endCommitID string) (in
 | 
			
		||||
 | 
			
		||||
// CommitsBetween returns a list that contains commits between [last, before).
 | 
			
		||||
func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List, error) {
 | 
			
		||||
	if version.Compare(gitVersion, "1.8.0", ">=") {
 | 
			
		||||
		stdout, err := NewCommand("rev-list", before.ID.String()+"..."+last.ID.String()).RunInDirBytes(repo.Path)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
		return repo.parsePrettyFormatLogToList(bytes.TrimSpace(stdout))
 | 
			
		||||
	stdout, err := NewCommand("rev-list", before.ID.String()+"..."+last.ID.String()).RunInDirBytes(repo.Path)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Fallback to stupid solution, which iterates all commits of the repository
 | 
			
		||||
	// if before is not an ancestor of last.
 | 
			
		||||
	l := list.New()
 | 
			
		||||
	if last == nil || last.ParentCount() == 0 {
 | 
			
		||||
		return l, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var err error
 | 
			
		||||
	cur := last
 | 
			
		||||
	for {
 | 
			
		||||
		if cur.ID.Equal(before.ID) {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
		l.PushBack(cur)
 | 
			
		||||
		if cur.ParentCount() == 0 {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
		cur, err = cur.Parent(0)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return l, nil
 | 
			
		||||
	return repo.parsePrettyFormatLogToList(bytes.TrimSpace(stdout))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CommitsBetweenIDs return commits between twoe commits
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								vendor/code.gitea.io/git/signature.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								vendor/code.gitea.io/git/signature.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -32,17 +32,22 @@ func newSignatureFromCommitline(line []byte) (_ *Signature, err error) {
 | 
			
		||||
	sig.Email = string(line[emailStart+1 : emailEnd])
 | 
			
		||||
 | 
			
		||||
	// Check date format.
 | 
			
		||||
	firstChar := line[emailEnd+2]
 | 
			
		||||
	if firstChar >= 48 && firstChar <= 57 {
 | 
			
		||||
		timestop := bytes.IndexByte(line[emailEnd+2:], ' ')
 | 
			
		||||
		timestring := string(line[emailEnd+2 : emailEnd+2+timestop])
 | 
			
		||||
		seconds, _ := strconv.ParseInt(timestring, 10, 64)
 | 
			
		||||
		sig.When = time.Unix(seconds, 0)
 | 
			
		||||
	} else {
 | 
			
		||||
		sig.When, err = time.Parse("Mon Jan _2 15:04:05 2006 -0700", string(line[emailEnd+2:]))
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
	if len(line) > emailEnd+2 {
 | 
			
		||||
		firstChar := line[emailEnd+2]
 | 
			
		||||
		if firstChar >= 48 && firstChar <= 57 {
 | 
			
		||||
			timestop := bytes.IndexByte(line[emailEnd+2:], ' ')
 | 
			
		||||
			timestring := string(line[emailEnd+2 : emailEnd+2+timestop])
 | 
			
		||||
			seconds, _ := strconv.ParseInt(timestring, 10, 64)
 | 
			
		||||
			sig.When = time.Unix(seconds, 0)
 | 
			
		||||
		} else {
 | 
			
		||||
			sig.When, err = time.Parse("Mon Jan _2 15:04:05 2006 -0700", string(line[emailEnd+2:]))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return nil, err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		// Fall back to unix 0 time
 | 
			
		||||
		sig.When = time.Unix(0, 0)
 | 
			
		||||
	}
 | 
			
		||||
	return sig, nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										40
									
								
								vendor/code.gitea.io/git/tree_entry.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										40
									
								
								vendor/code.gitea.io/git/tree_entry.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -116,35 +116,51 @@ func (te *TreeEntry) GetSubJumpablePathName() string {
 | 
			
		||||
// Entries a list of entry
 | 
			
		||||
type Entries []*TreeEntry
 | 
			
		||||
 | 
			
		||||
var sorter = []func(t1, t2 *TreeEntry) bool{
 | 
			
		||||
	func(t1, t2 *TreeEntry) bool {
 | 
			
		||||
type customSortableEntries struct {
 | 
			
		||||
	Comparer func(s1, s2 string) bool
 | 
			
		||||
	Entries
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var sorter = []func(t1, t2 *TreeEntry, cmp func(s1, s2 string) bool) bool{
 | 
			
		||||
	func(t1, t2 *TreeEntry, cmp func(s1, s2 string) bool) bool {
 | 
			
		||||
		return (t1.IsDir() || t1.IsSubModule()) && !t2.IsDir() && !t2.IsSubModule()
 | 
			
		||||
	},
 | 
			
		||||
	func(t1, t2 *TreeEntry) bool {
 | 
			
		||||
		return t1.name < t2.name
 | 
			
		||||
	func(t1, t2 *TreeEntry, cmp func(s1, s2 string) bool) bool {
 | 
			
		||||
		return cmp(t1.name, t2.name)
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (tes Entries) Len() int      { return len(tes) }
 | 
			
		||||
func (tes Entries) Swap(i, j int) { tes[i], tes[j] = tes[j], tes[i] }
 | 
			
		||||
func (tes Entries) Less(i, j int) bool {
 | 
			
		||||
	t1, t2 := tes[i], tes[j]
 | 
			
		||||
func (ctes customSortableEntries) Len() int { return len(ctes.Entries) }
 | 
			
		||||
 | 
			
		||||
func (ctes customSortableEntries) Swap(i, j int) {
 | 
			
		||||
	ctes.Entries[i], ctes.Entries[j] = ctes.Entries[j], ctes.Entries[i]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ctes customSortableEntries) Less(i, j int) bool {
 | 
			
		||||
	t1, t2 := ctes.Entries[i], ctes.Entries[j]
 | 
			
		||||
	var k int
 | 
			
		||||
	for k = 0; k < len(sorter)-1; k++ {
 | 
			
		||||
		s := sorter[k]
 | 
			
		||||
		switch {
 | 
			
		||||
		case s(t1, t2):
 | 
			
		||||
		case s(t1, t2, ctes.Comparer):
 | 
			
		||||
			return true
 | 
			
		||||
		case s(t2, t1):
 | 
			
		||||
		case s(t2, t1, ctes.Comparer):
 | 
			
		||||
			return false
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return sorter[k](t1, t2)
 | 
			
		||||
	return sorter[k](t1, t2, ctes.Comparer)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Sort sort the list of entry
 | 
			
		||||
func (tes Entries) Sort() {
 | 
			
		||||
	sort.Sort(tes)
 | 
			
		||||
	sort.Sort(customSortableEntries{func(s1, s2 string) bool {
 | 
			
		||||
		return s1 < s2
 | 
			
		||||
	}, tes})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CustomSort customizable string comparing sort entry list
 | 
			
		||||
func (tes Entries) CustomSort(cmp func(s1, s2 string) bool) {
 | 
			
		||||
	sort.Sort(customSortableEntries{cmp, tes})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type commitInfo struct {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								vendor/vendor.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/vendor.json
									
									
									
									
										vendored
									
									
								
							@@ -3,10 +3,10 @@
 | 
			
		||||
	"ignore": "test appengine",
 | 
			
		||||
	"package": [
 | 
			
		||||
		{
 | 
			
		||||
			"checksumSHA1": "fR5YDSoG7xYv2aLO23rne95gWps=",
 | 
			
		||||
			"checksumSHA1": "JN/re4+x/hCzMLGHmieUcykVDAg=",
 | 
			
		||||
			"path": "code.gitea.io/git",
 | 
			
		||||
			"revision": "479f87e5d189e7b8f1fd51dbcd25faa32b632cd2",
 | 
			
		||||
			"revisionTime": "2017-08-03T00:53:29Z"
 | 
			
		||||
			"revision": "d47b98c44c9a6472e44ab80efe65235e11c6da2a",
 | 
			
		||||
			"revisionTime": "2017-10-23T00:52:09Z"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"checksumSHA1": "Zgp5RqU+20L2p9TNl1rSsUIWEEE=",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user