Skip to content

Use case-insensitive matching for Git error message "Not a valid object name" #3309

@mdferdousalam

Description

@mdferdousalam

Summary

Git is changing the capitalization of its fatal: Not a valid object name error message to lowercase (fatal: not a valid object name) to follow Git's CodingGuidelines, which state that error messages should begin with a lowercase letter.

This change is under review on the Git mailing list:
https://lore.kernel.org/git/pull.2052.git.1771836302101.gitgitgadget@gmail.com

Problem

This repo currently uses case-sensitive string matching to detect this Git error, which will break when Git ships the updated message.

Affected files

  • preview/git.js — `stderrBuffer.includes("Not a valid object name")` and `err.message.includes("Not a valid object name")`

Suggested fix

Use case-insensitive comparison, for example:
```javascript
stderrBuffer.toLowerCase().includes("not a valid object name")
```

This will work with both the current and future Git versions.

Timeline

The Git change is currently under review and will likely be included in a future Git release. Fixing the matching now ensures forward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions