|
|
@ -185,12 +185,12 @@ func (t *TemporaryUploadRepository) GetLastCommitByRef(ref string) (string, erro |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CommitTree creates a commit from a given tree for the user with provided message
|
|
|
|
// CommitTree creates a commit from a given tree for the user with provided message
|
|
|
|
func (t *TemporaryUploadRepository) CommitTree(author, committer *models.User, treeHash string, message string) (string, error) { |
|
|
|
func (t *TemporaryUploadRepository) CommitTree(author, committer *models.User, treeHash string, message string, signoff bool) (string, error) { |
|
|
|
return t.CommitTreeWithDate(author, committer, treeHash, message, time.Now(), time.Now()) |
|
|
|
return t.CommitTreeWithDate(author, committer, treeHash, message, signoff, time.Now(), time.Now()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CommitTreeWithDate creates a commit from a given tree for the user with provided message
|
|
|
|
// CommitTreeWithDate creates a commit from a given tree for the user with provided message
|
|
|
|
func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models.User, treeHash string, message string, authorDate, committerDate time.Time) (string, error) { |
|
|
|
func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models.User, treeHash string, message string, signoff bool, authorDate, committerDate time.Time) (string, error) { |
|
|
|
authorSig := author.NewGitSig() |
|
|
|
authorSig := author.NewGitSig() |
|
|
|
committerSig := committer.NewGitSig() |
|
|
|
committerSig := committer.NewGitSig() |
|
|
|
|
|
|
|
|
|
|
@ -236,6 +236,13 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if signoff { |
|
|
|
|
|
|
|
// Signed-off-by
|
|
|
|
|
|
|
|
_, _ = messageBytes.WriteString("\n") |
|
|
|
|
|
|
|
_, _ = messageBytes.WriteString("Signed-off-by: ") |
|
|
|
|
|
|
|
_, _ = messageBytes.WriteString(committerSig.String()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
env = append(env, |
|
|
|
env = append(env, |
|
|
|
"GIT_COMMITTER_NAME="+committerSig.Name, |
|
|
|
"GIT_COMMITTER_NAME="+committerSig.Name, |
|
|
|
"GIT_COMMITTER_EMAIL="+committerSig.Email, |
|
|
|
"GIT_COMMITTER_EMAIL="+committerSig.Email, |
|
|
|