Fixed lint errors in hook_pre_recieve.go

This commit is contained in:
DmitryFrolovTri
2023-05-23 06:42:42 +00:00
parent c96ec8d138
commit 256173fc25
+4 -4
View File
@@ -110,15 +110,15 @@ func CalculateSizeOfObject(ctx *gitea_context.PrivateContext, opts *git.RunOpts,
objectSizeStr, _, err := git.NewCommand(ctx, "cat-file", "-s").AddDynamicArguments(objectID).RunStdString(opts)
if err != nil {
log.Trace("CalculateSizeOfRemovedObjects: Error during git cat-file -s on object: %s", objectID)
return
return objectSize
}
objectSize, _ = strconv.ParseInt(strings.TrimSpace(objectSizeStr), 10, 64)
if err != nil {
log.Trace("CalculateSizeOfRemovedObjects: Error during ParseInt on string '%s'", objectID)
return
return objectSize
}
return
return objectSize
}
// CalculateSizeOfObjects calculates the size of objects added and removed from the repository by new commit
@@ -148,7 +148,7 @@ func CalculateSizeOfObjects(ctx *gitea_context.PrivateContext, opts *git.RunOpts
}
}
}
return
return addedSize, removedSize
}
// ConvertObjectsToMap takes a newline-separated string of git objects and