Skip to content

fix: add user-friendly error messages for remote git operation failures#1164

Open
hztBUAA wants to merge 2 commits intoyamadashy:mainfrom
hztBUAA:fix/remote-repo-timeout
Open

fix: add user-friendly error messages for remote git operation failures#1164
hztBUAA wants to merge 2 commits intoyamadashy:mainfrom
hztBUAA:fix/remote-repo-timeout

Conversation

@hztBUAA
Copy link
Copy Markdown

@hztBUAA hztBUAA commented Feb 20, 2026

Summary

  • Adds a createGitRemoteError helper that inspects error properties (killed, signal, stderr) to produce clear, actionable error messages for different failure modes
  • Wraps raw errors in execLsRemote, execGitShallowClone (both clone and fetch paths) with descriptive RepomixError messages
  • Distinguishes between: timeout (process killed by 30s timeout), authentication required (private repos / bad URLs), repository not found, connection errors (DNS / refused), and generic failures
  • Prevents unnecessary short SHA fallback retries when the remote is unreachable (timeout check before retry logic)
  • Adds comprehensive tests for all error categories (8 unit tests for createGitRemoteError + 5 integration tests for timeout/error handling in actual git operations)

This builds on the existing GIT_TERMINAL_PROMPT=0 and 30s timeout from #1078 to complete the error handling story — users now get messages like:

  • Git clone timed out after 30 seconds for <url>. The repository may be inaccessible...
  • Git ls-remote failed for <url>: Authentication required. The repository may be private...
  • Git clone failed for <url>: Repository not found. Please verify the URL is correct.

Fixes #1077

Test plan

  • All 37 tests in gitCommand.test.ts pass (13 new tests added)
  • All 145 git-related tests pass
  • Full test suite (1107 tests across 113 files) passes with no regressions
  • Biome lint/format passes

Open with Devin

Improve error handling for remote git operations (clone, fetch, ls-remote)
by wrapping raw errors in descriptive RepomixError messages that distinguish
between timeout, authentication, repository-not-found, and connection errors.

This builds on the existing GIT_TERMINAL_PROMPT=0 and 30s timeout to provide
clear, actionable error messages when accessing inaccessible repositories.

Fixes yamadashy#1077
@hztBUAA hztBUAA requested a review from yamadashy as a code owner February 20, 2026 05:18
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @hztBUAA, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the error handling for remote Git operations by providing clear, actionable, and user-friendly messages. It centralizes error processing through a new helper function, which intelligently parses raw Git errors to categorize and explain common failure scenarios like timeouts, authentication problems, and repository unavailability. This improvement prevents redundant operations and offers immediate guidance to users, streamlining the debugging process for remote repository interactions.

Highlights

  • Enhanced Error Messaging: Introduced a createGitRemoteError helper function to generate user-friendly and actionable error messages for various remote Git operation failures.
  • Improved Error Handling Integration: Integrated the new error helper into execLsRemote and execGitShallowClone to provide descriptive RepomixError messages for different failure modes.
  • Specific Error Categorization: Implemented distinct error messages for timeouts, authentication failures, repository not found scenarios, and connection issues, providing clearer guidance to users.
  • Optimized Retry Logic: Added a timeout check in execGitShallowClone to prevent unnecessary short SHA fallback retries when the remote repository is unreachable.
  • Comprehensive Testing: Expanded the test suite with 13 new tests, including 8 unit tests for createGitRemoteError and 5 integration tests for timeout and error handling in actual Git operations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/core/git/gitCommand.ts
    • Added ExecFileError interface to type execFileAsync errors.
    • Implemented createGitRemoteError function to parse raw execFileAsync errors and return specific RepomixError messages based on stderr content and error properties (e.g., killed, signal).
    • Modified execLsRemote to catch errors and rethrow them using createGitRemoteError with the operation 'ls-remote'.
    • Updated execGitShallowClone to apply createGitRemoteError for 'fetch' and 'clone' operations.
    • Introduced a timeout check in execGitShallowClone before attempting short SHA fallback, ensuring that unreachable remotes do not trigger unnecessary retries.
  • tests/core/git/gitCommand.test.ts
    • Imported createGitRemoteError and RepomixError for testing.
    • Adjusted existing execGitShallowClone tests to expect RepomixError or specific messages from the new error handling.
    • Added a new describe block for createGitRemoteError with 8 unit tests covering timeout, authentication, repository not found, connection, and generic error scenarios.
    • Added a new describe block for timeout and error handling for remote operations with 5 integration tests, verifying execLsRemote and execGitShallowClone correctly throw descriptive timeout, repository not found, and authentication errors.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 20, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Introduces a centralized error handling mechanism for Git remote operations through a new createGitRemoteError function that maps stderr patterns and error states (timeout, authentication, not-found, network errors) to standardized RepomixError messages. Updates execLsRemote and execGitShallowClone to use this function instead of propagating raw errors.

Changes

Cohort / File(s) Summary
Core Error Handling
src/core/git/gitCommand.ts
Added ExecFileError interface and exported createGitRemoteError function that maps stderr patterns and error states (timeout, authentication failure, repository not found, connection errors) to standardized RepomixError messages. Updated execLsRemote, execGitShallowClone error paths to use the new error mapper for consistent error classification.
Test Suite Updates
tests/core/git/gitCommand.test.ts
Added comprehensive test suite for createGitRemoteError covering timeout scenarios (killed process, SIGTERM), authentication failures, not-found errors, DNS/network errors, and connection refusals. Updated existing test expectations to assert RepomixError instances instead of generic error strings, with explicit timeout behavior validation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #1078: Adds timeout configuration and GIT_TERMINAL_PROMPT=0 environment variable to git command execution, directly complementing the error handling centralization in this PR.
  • #583: Modifies execGitShallowClone and remote command error handling paths in the same file.
  • #270: Updates remote clone/fetch execution paths in git command utilities.

Suggested reviewers

  • yamadashy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding user-friendly error messages for remote git operation failures, which aligns with the primary objective of improving error handling in the changeset.
Description check ✅ Passed The description comprehensively covers the changes, test results, and references the linked issue. It includes a detailed summary section and test plan, though it doesn't strictly follow the template's checklist format.
Linked Issues check ✅ Passed The PR addresses issue #1077 by implementing timeout handling (30s) and GIT_TERMINAL_PROMPT=0 environment variable, and adds createGitRemoteError to provide user-friendly error messages for timeout, authentication, not-found, and connection failures.
Out of Scope Changes check ✅ Passed All changes are scoped to the linked issue #1077: new error handler, updated git command error handling, comprehensive tests, and no unrelated modifications to other areas.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/core/git/gitCommand.ts (1)

201-204: ⚠️ Potential issue | 🟡 Minor

Short-SHA retry path propagates raw errors instead of RepomixError.

If the full git fetch origin (line 203) or git checkout (line 204) fails — for example due to a timeout or authentication issue — the error is not wrapped with createGitRemoteError, so the user gets a raw error message instead of the friendly one. This is inconsistent with the other error paths in this function.

Suggested fix
       // Maybe the error is due to a short SHA, let's try again
       // Can't use --depth 1 here as we need to fetch the specific commit
-      await deps.execFileAsync('git', ['-C', directory, 'fetch', 'origin'], gitRemoteOpts);
-      await deps.execFileAsync('git', ['-C', directory, 'checkout', remoteBranch]);
+      try {
+        await deps.execFileAsync('git', ['-C', directory, 'fetch', 'origin'], gitRemoteOpts);
+        await deps.execFileAsync('git', ['-C', directory, 'checkout', remoteBranch]);
+      } catch (retryErr) {
+        throw createGitRemoteError(retryErr, url, 'fetch');
+      }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/git/gitCommand.ts` around lines 201 - 204, The short-SHA retry path
currently calls deps.execFileAsync('git', ['-C', directory, 'fetch', 'origin'],
gitRemoteOpts) and deps.execFileAsync('git', ['-C', directory, 'checkout',
remoteBranch]) without wrapping failures, so propagate failures using
createGitRemoteError like the other branches: catch errors from both fetch and
checkout (around the execFileAsync calls), pass the caught error into
createGitRemoteError along with gitRemoteOpts (and any context such as
directory/remoteBranch), and rethrow the resulting RepomixError so callers
receive the consistent error type.
🧹 Nitpick comments (4)
src/core/git/gitCommand.ts (3)

14-59: createGitRemoteError is well-structured; one robustness nit on the generic fallback.

When error is not an Error instance (e.g., a string or null thrown from a dependency), err.message at line 58 will be undefined, producing a message like "Git fetch failed for url: undefined". Consider a defensive fallback:

Suggested improvement
-  // Generic fallback
-  return new RepomixError(`Git ${operation} failed for ${url}: ${err.message}`);
+  // Generic fallback
+  const message = err.message || String(error);
+  return new RepomixError(`Git ${operation} failed for ${url}: ${message}`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/git/gitCommand.ts` around lines 14 - 59, The generic fallback in
createGitRemoteError can produce "undefined" when error isn't an Error; update
createGitRemoteError (and its use of ExecFileError) to defensively derive a safe
message and stderr: compute a string message from the incoming error (e.g., if
typeof error === 'string' use it, else use err?.message ?? String(error) ?? '')
and use that when building stderr and the final RepomixError; ensure all
accesses use optional chaining (err?.stderr) to avoid exceptions when error is
null/primitive so the final message never contains "undefined".

39-44: The 'not found' substring check is broad.

stderr.includes('not found') could match unrelated messages (e.g., "credential helper not found"). Consider tightening the match — for instance, checking for 'not found' only after a pattern like remote: or combining it with the other more specific checks, or removing the generic 'not found' and relying on 'does not exist' and 'Repository not found' which are more precise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/git/gitCommand.ts` around lines 39 - 44, The check for
repository-not-found is too broad because stderr.includes('not found') can match
unrelated messages; update the condition that builds the RepomixError to only
treat "not found" as a repo error when it's clearly a remote response (e.g.,
require stderr.toLowerCase().includes('remote:') &&
stderr.toLowerCase().includes('not found')) or remove the generic 'not found'
check entirely and rely on the more specific checks ('does not exist' and
'Repository not found'); modify the condition around stderr (the variables
stderr, operation, url and the RepomixError creation in gitCommand.ts)
accordingly so only the tightened match triggers the Repository not found error.

165-167: git init and git remote add failures propagate as raw errors.

Lines 166–167 are not inside the try-catch block that starts at line 168. If these local git commands fail (e.g., invalid directory, permissions), the user receives a raw error rather than a RepomixError. Since these are local operations (not remote), createGitRemoteError may not be the right wrapper, but you might still want a RepomixError with a clear message for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/git/gitCommand.ts` around lines 165 - 167, The two local git
invocations guarded by remoteBranch (deps.execFileAsync('git', ['-C', directory,
'init']) and deps.execFileAsync('git', ['-C', directory, 'remote', 'add', '--',
'origin', url'])) are executed outside the try-catch that throws
createGitRemoteError, so failures surface as raw errors; wrap these calls in
their own try-catch and rethrow a RepomixError (or construct a new error type
consistent with existing flows) with a clear message like "failed to initialize
local git repository" or "failed to add git remote" and include the original
error details, referencing deps.execFileAsync, remoteBranch and
createGitRemoteError/RepomixError to locate and apply the change.
tests/core/git/gitCommand.test.ts (1)

503-573: Consider adding a test for the short-SHA retry path failure.

The integration tests don't cover the scenario where the short-SHA retry (git fetch origin without --depth 1) itself fails — e.g., times out or hits an auth error. This relates to the unhandled error path at lines 203–204 in gitCommand.ts. A test here would help catch that gap.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/core/git/gitCommand.test.ts` around lines 503 - 573, Add a test
exercising the short‑SHA retry failure in execGitShallowClone: mock
execFileAsync to succeed for git init and git remote add, then reject the first
git fetch (triggering the short‑SHA fallback) and also reject the subsequent
fallback fetch (e.g., with a timeout or auth error); assert execGitShallowClone
rejects with the expected error and that execFileAsync was called the expected
number of times (including the fallback), referencing execGitShallowClone and
the git fetch/short‑SHA retry path so the unhandled error branch is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/core/git/gitCommand.ts`:
- Around line 201-204: The short-SHA retry path currently calls
deps.execFileAsync('git', ['-C', directory, 'fetch', 'origin'], gitRemoteOpts)
and deps.execFileAsync('git', ['-C', directory, 'checkout', remoteBranch])
without wrapping failures, so propagate failures using createGitRemoteError like
the other branches: catch errors from both fetch and checkout (around the
execFileAsync calls), pass the caught error into createGitRemoteError along with
gitRemoteOpts (and any context such as directory/remoteBranch), and rethrow the
resulting RepomixError so callers receive the consistent error type.

---

Nitpick comments:
In `@src/core/git/gitCommand.ts`:
- Around line 14-59: The generic fallback in createGitRemoteError can produce
"undefined" when error isn't an Error; update createGitRemoteError (and its use
of ExecFileError) to defensively derive a safe message and stderr: compute a
string message from the incoming error (e.g., if typeof error === 'string' use
it, else use err?.message ?? String(error) ?? '') and use that when building
stderr and the final RepomixError; ensure all accesses use optional chaining
(err?.stderr) to avoid exceptions when error is null/primitive so the final
message never contains "undefined".
- Around line 39-44: The check for repository-not-found is too broad because
stderr.includes('not found') can match unrelated messages; update the condition
that builds the RepomixError to only treat "not found" as a repo error when it's
clearly a remote response (e.g., require
stderr.toLowerCase().includes('remote:') && stderr.toLowerCase().includes('not
found')) or remove the generic 'not found' check entirely and rely on the more
specific checks ('does not exist' and 'Repository not found'); modify the
condition around stderr (the variables stderr, operation, url and the
RepomixError creation in gitCommand.ts) accordingly so only the tightened match
triggers the Repository not found error.
- Around line 165-167: The two local git invocations guarded by remoteBranch
(deps.execFileAsync('git', ['-C', directory, 'init']) and
deps.execFileAsync('git', ['-C', directory, 'remote', 'add', '--', 'origin',
url'])) are executed outside the try-catch that throws createGitRemoteError, so
failures surface as raw errors; wrap these calls in their own try-catch and
rethrow a RepomixError (or construct a new error type consistent with existing
flows) with a clear message like "failed to initialize local git repository" or
"failed to add git remote" and include the original error details, referencing
deps.execFileAsync, remoteBranch and createGitRemoteError/RepomixError to locate
and apply the change.

In `@tests/core/git/gitCommand.test.ts`:
- Around line 503-573: Add a test exercising the short‑SHA retry failure in
execGitShallowClone: mock execFileAsync to succeed for git init and git remote
add, then reject the first git fetch (triggering the short‑SHA fallback) and
also reject the subsequent fallback fetch (e.g., with a timeout or auth error);
assert execGitShallowClone rejects with the expected error and that
execFileAsync was called the expected number of times (including the fallback),
referencing execGitShallowClone and the git fetch/short‑SHA retry path so the
unhandled error branch is covered.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request significantly improves the user experience by providing actionable and descriptive error messages for common Git remote operation failures (timeouts, authentication issues, missing repositories, and connection problems). However, it introduces a potential security risk where sensitive credentials embedded in Git URLs could be leaked in error messages and logs. My feedback focuses on enhancing the robustness of error parsing to handle non-object errors safely, ensuring that the original error context is preserved using the cause property in RepomixError, and redacting credentials from the URL before including it in any error messages.

Comment on lines +21 to +59
export const createGitRemoteError = (error: unknown, url: string, operation: string): RepomixError => {
const err = error as ExecFileError;
const stderr = err.stderr || err.message || '';

// Timeout: process was killed by the timeout option
if (err.killed || err.signal === 'SIGTERM') {
return new RepomixError(
`Git ${operation} timed out after ${GIT_REMOTE_TIMEOUT / 1000} seconds for ${url}. The repository may be inaccessible, or the network connection is too slow.`,
);
}

// Authentication failure
if (stderr.includes('Authentication failed') || stderr.includes('could not read Username')) {
return new RepomixError(
`Git ${operation} failed for ${url}: Authentication required. The repository may be private or the URL may be incorrect.`,
);
}

// Repository not found
if (stderr.includes('not found') || stderr.includes('does not exist') || stderr.includes('Repository not found')) {
return new RepomixError(
`Git ${operation} failed for ${url}: Repository not found. Please verify the URL is correct.`,
);
}

// Connection errors
if (
stderr.includes('Could not resolve host') ||
stderr.includes('Failed to connect') ||
stderr.includes('Connection refused')
) {
return new RepomixError(
`Git ${operation} failed for ${url}: Unable to connect to the remote host. Please check your network connection and the URL.`,
);
}

// Generic fallback
return new RepomixError(`Git ${operation} failed for ${url}: ${err.message}`);
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The createGitRemoteError function includes the raw url in the error message. If the URL contains embedded credentials (e.g., https://user:password@github.com/repo.git), they will be included in the error message, leading to sensitive information leakage. You should redact credentials from the URL before including it in the error message. Additionally, the function currently assumes that the error parameter is an object that can be safely cast to ExecFileError. If error is null or a primitive, accessing its properties will throw a TypeError, masking the original issue. It's also a best practice to preserve the original error context by passing it as the cause to the new RepomixError.

export const createGitRemoteError = (error: unknown, url: string, operation: string): RepomixError => {
  const err = error as Partial<ExecFileError>;
  const message = err?.message || String(error);
  const stderr = err?.stderr || message || '';

  // Redact embedded credentials in URLs to avoid PII leakage
  const redactedUrl = url.startsWith('https://') ? url.replace(/^(https?://)([^@/]+)@/i, '$1***@') : url;

  // Timeout: process was killed by the timeout option
  if (err?.killed || err?.signal === 'SIGTERM') {
    return new RepomixError(
      `Git ${operation} timed out after ${GIT_REMOTE_TIMEOUT / 1000} seconds for ${redactedUrl}. The repository may be inaccessible, or the network connection is too slow.`,
      { cause: error },
    );
  }

  // Authentication failure
  if (stderr.includes('Authentication failed') || stderr.includes('could not read Username')) {
    return new RepomixError(
      `Git ${operation} failed for ${redactedUrl}: Authentication required. The repository may be private or the URL may be incorrect.`,
      { cause: error },
    );
  }

  // Repository not found
  if (stderr.includes('not found') || stderr.includes('does not exist') || stderr.includes('Repository not found')) {
    return new RepomixError(
      `Git ${operation} failed for ${redactedUrl}: Repository not found. Please verify the URL is correct.`,
      { cause: error },
    );
  }

  // Connection errors
  if (
    stderr.includes('Could not resolve host') ||
    stderr.includes('Failed to connect') ||
    stderr.includes('Connection refused')
  ) {
    return new RepomixError(
      `Git ${operation} failed for ${redactedUrl}: Unable to connect to the remote host. Please check your network connection and the URL.`,
      { cause: error },
    );
  }

  // Generic fallback
  return new RepomixError(`Git ${operation} failed for ${redactedUrl}: ${message}`, { cause: error });
};

Comment on lines +177 to +180
const execErr = err as ExecFileError;
if (execErr.killed || execErr.signal === 'SIGTERM') {
throw createGitRemoteError(err, url, 'fetch');
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the helper function, this direct access to err properties should be made safer to avoid potential crashes if err is not an object. Using optional chaining and a partial cast provides better safety.

      const execErr = err as Partial<ExecFileError>;
      if (execErr?.killed || execErr?.signal === 'SIGTERM') {
        throw createGitRemoteError(err, url, 'fetch');
      }

…s issues

Address PR review feedback from gemini-code-assist and coderabbitai:

- Redact embedded credentials from URLs in error messages to prevent
  sensitive information leakage (e.g. https://user:pass@host -> https://***@host)
- Use Partial<ExecFileError> with optional chaining for safe property
  access, preventing crashes when error is null or a primitive
- Preserve original error context via { cause: error } in RepomixError
- Tighten 'not found' substring check to avoid false positives from
  unrelated stderr messages (removed broad 'not found', kept specific
  'Repository not found' and 'does not exist')
- Wrap git init/remote add in try-catch with descriptive RepomixError
- Wrap short-SHA retry path in try-catch with createGitRemoteError
- Add tests for credential redaction, non-Error inputs, null inputs,
  cause preservation, short-SHA retry failure, and git init failure
@hztBUAA
Copy link
Copy Markdown
Author

hztBUAA commented Feb 25, 2026

Thanks for the review and feedback. I am following up on this PR now and will either push the requested changes or reply point-by-point shortly.

@hztBUAA
Copy link
Copy Markdown
Author

hztBUAA commented Feb 25, 2026

Quick follow-up: I am reviewing the feedback and will update this PR shortly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pack_remote_repository hangs indefinitely on inaccessible repos

1 participant