Skip to content

unable to create a gist with a file containing only whitespace characters #3481

@putnamhill

Description

@putnamhill

Description

When I try to create a gist from a file or stdin, containing only whitespace, I get a 422 validation failed error.

This can be reproduced in gh versions 1.8.1 and 1.9.2

Steps to reproduce the behavior

echo $' \t' | gh gist create
- Creating gist...
X Failed to create gist: HTTP 422: Validation Failed (https://api.github.com/gists)
Gist.files is missing

Expected vs actual behavior

I expect to see a message that reports "unable to create a gist from an empty file".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions