Thanks to visit codestin.com
Credit goes to github.com

Skip to content

git_patch_to_buf Does not work if underlying blob is freed #4442

@brandonio21

Description

@brandonio21

This issue was discovered in pygit2 libgit2/pygit2#754 and there are some pretty detailed reproduction steps there.

Reproductions steps

Create a patch object from at least one blob. Free the blob. Print the patch to a buffer. The patch will be mangled because the underlying blob was freed.

Expected behavior

A patch created from a blob should be able to print to a buffer without issue when the blob is freed.

In short, the patch should not need the blob to exist for it to print. The patch should hold a reference to the blob.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions