aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repository
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-06-30 17:03:05 +0800
committerGitHub <noreply@github.com>2023-06-30 17:03:05 +0800
commit65acd1e9ef9eda01fd9b07a72abafa2d7bf83435 (patch)
treee15f850f961783510651a1eb8cb50b4d0b4091ae /modules/repository
parent67bd9d4f1eedb4728031504d0dd09d014c0f3e6f (diff)
downloadgitea-65acd1e9ef9eda01fd9b07a72abafa2d7bf83435.tar.gz
gitea-65acd1e9ef9eda01fd9b07a72abafa2d7bf83435.zip
Fix branch commit message too long problem (#25588)
When branch's commit CommitMessage is too long, the column maybe too short.(TEXT 16K for mysql). This PR will fix it to only store the summary because these message will only show on branch list or possible future search?
Diffstat (limited to 'modules/repository')
-rw-r--r--modules/repository/branch.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/repository/branch.go b/modules/repository/branch.go
index 7fd29e3f7d..bffadd62f4 100644
--- a/modules/repository/branch.go
+++ b/modules/repository/branch.go
@@ -77,9 +77,9 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
RepoID: repo.ID,
Name: branch,
CommitID: commit.ID.String(),
- CommitMessage: commit.CommitMessage,
+ CommitMessage: commit.Summary(),
PusherID: doerID,
- CommitTime: timeutil.TimeStamp(commit.Author.When.Unix()),
+ CommitTime: timeutil.TimeStamp(commit.Committer.When.Unix()),
})
} else if commit.ID.String() != dbb.CommitID {
toUpdate = append(toUpdate, &git_model.Branch{
@@ -87,9 +87,9 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
RepoID: repo.ID,
Name: branch,
CommitID: commit.ID.String(),
- CommitMessage: commit.CommitMessage,
+ CommitMessage: commit.Summary(),
PusherID: doerID,
- CommitTime: timeutil.TimeStamp(commit.Author.When.Unix()),
+ CommitTime: timeutil.TimeStamp(commit.Committer.When.Unix()),
})
}
}