summaryrefslogtreecommitdiffstats
path: root/modules/repofiles/update.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repofiles/update.go')
-rw-r--r--modules/repofiles/update.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go
index 21df776060..26b5113f15 100644
--- a/modules/repofiles/update.go
+++ b/modules/repofiles/update.go
@@ -190,6 +190,13 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up
// Assigned LastCommitID in opts if it hasn't been set
if opts.LastCommitID == "" {
opts.LastCommitID = commit.ID.String()
+ } else {
+ lastCommitID, err := t.gitRepo.ConvertToSHA1(opts.LastCommitID)
+ if err != nil {
+ return nil, fmt.Errorf("DeleteRepoFile: Invalid last commit ID: %v", err)
+ }
+ opts.LastCommitID = lastCommitID.String()
+
}
encoding := "UTF-8"