patch

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: MIT Package patch provides helpers for handling bounded commit patch/diff text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumePatchBudget

func ConsumePatchBudget(patch string, budget int) (string, bool, int)

ConsumePatchBudget truncates patch text to a remaining byte budget. It returns the (possibly truncated) patch, a flag indicating whether truncation occurred, and the budget remaining after consumption.

This is used by both the GitHub and GitLab clients to enforce max_diff_bytes uniformly.

When truncation is required it backs off to the last whole-rune boundary at or below the byte budget so recorded evidence is always valid UTF-8 and never ends in a half-written multibyte character.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL