Skip to content

refactor(git): Fix stash status detection for all cases - #1586

Merged
aeppling merged 1 commit into
rtk-ai:developfrom
KuSh:git-stash-nothing
May 4, 2026
Merged

aeppling merged 1 commit into
rtk-ai:developfrom
KuSh:git-stash-nothing

Conversation

@KuSh

@KuSh KuSh commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Ensure "No local changes" status is detected for all stash operations, not just the default push case
  • Consolidate duplicate message formatting into format_stash_message() helper
  • Improve maintainability and reduce code duplication

Closes #1535

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk git stash and rtk git stash push myfile.txt output inspected

Consolidate stash default handlers to ensure "no local changes"
is properly detected across all stash operations, not just the
default push case.

Signed-off-by: Nicolas Le Cam <[email protected]>
@KuSh KuSh mentioned this pull request Apr 28, 2026
6 tasks done
@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal labels Apr 28, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

♻️ Type refactor
🟡 Risk medium

Summary

Refactors git stash command handling to detect 'No local changes' status for all stash create operations (push/save), not just the default bare 'git stash' case. Consolidates duplicate message formatting into a shared format_stash_message() helper and merges previously separate code paths for the default stash and explicit push/save subcommands.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1535


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@aeppling aeppling self-assigned this May 4, 2026
@aeppling

aeppling commented May 4, 2026

Copy link
Copy Markdown
Contributor

Hey @KuSh

LGTM, reproduced bug and fix.

Reproduced the bug on 0.37.2: git stash push and git stash push both report ok stash push when there's nothing to stash. Built the branch, all four variants (stash, stash push, stash push , stash save) now correctly return ok (nothing to stash).

@aeppling
aeppling merged commit b5500bb into rtk-ai:develop May 4, 2026
12 checks passed
@aeppling aeppling mentioned this pull request May 4, 2026
@KuSh
KuSh deleted the git-stash-nothing branch May 4, 2026 20:41
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
refactor(git): Fix stash status detection for all cases
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
refactor(git): Fix stash status detection for all cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants