fix: watch-pr crashes on repos with non-main default branch#139
Merged
Conversation
fetchFileChanges hardcoded origin/main for git diff --numstat, causing watch-pr to fail on repos using master, develop, or other base branches. Now uses the PR's actual base branch from GitHub metadata. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
=======================================
Coverage 85.72% 85.72%
=======================================
Files 115 115
Lines 14910 14911 +1
Branches 3217 3217
=======================================
+ Hits 12782 12783 +1
Misses 2128 2128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
watch-prhardcodedorigin/maininfetchFileChanges, causing it to crash withfatal: ambiguous argument 'origin/main...HEAD'on repos usingmaster,develop, or other base branchesfetchFileChangesinstead of hardcodingmainfetchFileChangeswas introducedTest plan
should use the provided base branch instead of hardcoded mainverifiesorigin/masteris passed throughbaseBranchparameterpnpm validatepasses (all pre-commit checks green)vv watch-pronihiservices/MPNAdminAngularPR Fix Hardcoded 'origin/main' in pre-commit Command #2 (base branch:master)🤖 Generated with Claude Code