Skip to content

Commit fb3e801

Browse files
committed
Update comments and names
1 parent 3ad1e7e commit fb3e801

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

services/repository/files/update.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,14 @@ func CreateOrUpdateFile(ctx context.Context, t *TemporaryUploadRepository, file
490490

491491
var treeObjectContentReader io.Reader = file.ContentReader
492492
var oldEntry *git.TreeEntry
493-
// If no new content is committed, use the file from the last commit as content
493+
// If no new content is committed, which is only the case if file is renamed, use the old file from the last commit as
494+
// content
494495
if file.ContentReader == nil {
495-
lastCommit, err := t.GetLastCommit(ctx)
496+
lastCommitID, err := t.GetLastCommit(ctx)
496497
if err != nil {
497498
return err
498499
}
499-
commit, err := t.GetCommit(lastCommit)
500+
commit, err := t.GetCommit(lastCommitID)
500501
if err != nil {
501502
return err
502503
}

0 commit comments

Comments
 (0)