Skip to content

git stderr ('not a git repository') leaks to terminal when working outside a repo #1

Description

@D3mianGianoz

Symptom

Running pify/yolo in a folder that is not a git repository prints git fatal messages to the terminal:

fatal: not a git repository (or any of the parent directories): .git

This happens on every risky bash/powershell command and on /yolo rewind because git is called without suppressing stderr. The extension already catches the error (gitHead returns null; decideCheckpoint returns {failed:true}), but stderr still leaks.

Fix

Pass stdio: ["ignore", "pipe", "ignore"] to the 5 execFileSync("git", ...) calls in extensions/yolo.ts (gitHead, gitCheckpoint runGit + update-ref, releaseRefs, /yolo rewind restore). Stdout keeps working; only stderr is silenced.

A PR with the same fix is proposed in #2

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions