Skip to content

feat: Improve handling of missing git repo directory#1411

Merged
notheotherben merged 7 commits intomainfrom
test/git-errors
Mar 27, 2025
Merged

feat: Improve handling of missing git repo directory#1411
notheotherben merged 7 commits intomainfrom
test/git-errors

Conversation

@notheotherben
Copy link
Copy Markdown
Member

This PR adds logic to explicitly check the existence of a git repo directory before spawning a git command in said directory, allowing us to present better error messages to the user in these situations (instead of a generic File not found (error code 2) error).

@notheotherben notheotherben requested a review from cedi March 27, 2025 17:41
@notheotherben notheotherben added bug Something isn't working enhancement New feature or request labels Mar 27, 2025
Copy link
Copy Markdown
Collaborator

@cedi cedi left a comment

Choose a reason for hiding this comment

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

LGTM - there are some build failures through that would need to be fixed.

Comment thread src/git/remote.rs Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 95.12195% with 4 lines in your changes missing coverage. Please review.

Project coverage is 84.59%. Comparing base (363f881) to head (fbc1c41).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
src/git/cmd.rs 50.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1411      +/-   ##
==========================================
+ Coverage   84.51%   84.59%   +0.07%     
==========================================
  Files          93       93              
  Lines        9416     9497      +81     
==========================================
+ Hits         7958     8034      +76     
- Misses       1458     1463       +5     
Files with missing lines Coverage Δ
src/commands/clone.rs 78.28% <100.00%> (-0.33%) ⬇️
src/commands/complete.rs 95.13% <100.00%> (ø)
src/commands/new.rs 93.50% <100.00%> (+0.17%) ⬆️
src/commands/open.rs 78.88% <100.00%> (-0.50%) ⬇️
src/commands/prune.rs 96.46% <100.00%> (+0.01%) ⬆️
src/core/templates.rs 93.65% <ø> (ø)
src/git/add.rs 100.00% <100.00%> (ø)
src/git/branch.rs 99.73% <100.00%> (+<0.01%) ⬆️
src/git/checkout.rs 100.00% <100.00%> (ø)
src/git/commit.rs 100.00% <100.00%> (ø)
... and 12 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@notheotherben notheotherben merged commit 8a21b46 into main Mar 27, 2025
11 checks passed
@notheotherben notheotherben deleted the test/git-errors branch March 27, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants