Skip to content

Replace the literal NUL bytes in git-diff.ts and failure-baseline.ts with the \0 escape #125

Closed

Description

@adityankale190895

Two source files contain a raw NUL byte inside a string literal instead of the "\0" escape:

The code works, but tools now treat both files as binary. git ls-files --eol reports them as i/-text, grep prints "Binary file matches", and ripgrep skips them. For example, rg CONFIG_PATTERNS src finds nothing, although CONFIG_PATTERNS is defined at git-diff.ts:199. Contributors and coding agents who search the repository miss these two files.

Replace each raw byte with the escape "\0", which is the same string at run time. Then add a small test, for example tests/source-text.test.ts, that reads every .ts file under src/ and packages/diffci-cli/src/ and fails if one contains a \0 byte. Read the files as buffers, so the test does not depend on editor settings.

Done when: git ls-files --eol src packages/diffci-cli/src shows no i/-text entry, rg CONFIG_PATTERNS src finds git-diff.ts, and the new test fails if a raw NUL byte is added back. No behaviour change.

Setup and conventions are in CONTRIBUTING.md: run npm test, sign off commits with git commit -s (DCO). Comment here if you want to take it, and ask anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions