Skip to content

pack_remote_repository hangs indefinitely on inaccessible repos #1077

@Pipboyguy

Description

@Pipboyguy

Description

When using pack_remote_repository (MCP) or --remote (CLI) with an inaccessible repository (non-existent, private, or requiring auth), repomix hangs indefinitely.

Root Cause

execLsRemote in src/core/git/gitCommand.ts has no timeout and doesn't set GIT_TERMINAL_PROMPT=0. Git waits for credential input that never comes in non-interactive contexts.

Reproduce

npx repomix --remote https://github.com/user/nonexistent-repo

Expected

Fail with error after reasonable timeout.

Fix

const result = await deps.execFileAsync('git', ['ls-remote', ...], {
  timeout: 30000,
  env: { ...process.env, GIT_TERMINAL_PROMPT: '0' }
});

Apply to all git commands in gitCommand.ts.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions