Skip to content

feat(git): add operation timeouts and git ref validation#139

Merged
AmiteK23 merged 2 commits intomainfrom
feat/git-timeouts-ref-validation
Mar 7, 2026
Merged

feat(git): add operation timeouts and git ref validation#139
AmiteK23 merged 2 commits intomainfrom
feat/git-timeouts-ref-validation

Conversation

@AmiteK23
Copy link
Member

@AmiteK23 AmiteK23 commented Mar 7, 2026

Description

Adds timeout handling for git operations and lightweight validation for git refs.

Git commands now have dedicated timeouts to prevent long-running or stalled operations (especially in CI or large repositories).

Ref validation was added to sanitize input before passing it to git:

  • leading/trailing whitespace is trimmed
  • refs longer than 256 characters are rejected

Unit tests were expanded to cover validation behavior and whitespace handling.


Type of Change

  • Bug fix
  • Feature
  • Breaking change
  • Docs
  • Refactor
  • CI / Tests
  • Performance
  • Other (please describe):

Architectural Impact

  • No contract/output changes
  • Contract/output changed (describe below)

Testing

  • Tested locally
  • Tests added/updated
  • All tests pass

Related Issues

None.

Checklist

  • Target branch is main
  • Self-reviewed
  • Docs updated (if needed)
  • Changelog updated (if needed)

Additional Notes

Timeout defaults:

  • Ref resolution: 15s
  • Ref description: 15s
  • Worktree creation: 60s

These values provide safe headroom for large repositories while preventing stalled git operations.

AmiteK23 added 2 commits March 7, 2026 23:34
- Add dedicated timeouts for ref resolution, description, and worktree creation
- Introduce lightweight ref validation (trim + max length 256)
- Update git utilities to use new timeout configuration
- Extend unit tests for validation and whitespace handling
@AmiteK23 AmiteK23 merged commit 9be9024 into main Mar 7, 2026
7 checks passed
@AmiteK23 AmiteK23 deleted the feat/git-timeouts-ref-validation branch March 10, 2026 18:50
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.

1 participant