-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: show git branch if available #7532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💡 To request a new review, comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 issues found across 10 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| // Since we can't easily mock git commands in this test environment, | ||
| // we just test that the function returns either a string or null | ||
| const result = getGitBranch(); | ||
| expect(typeof result === "string" || result === null).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assertion is too weak and effectively tautological for a string | null return type; consider mocking git/execSync to assert specific outcomes (e.g., branch string in repo, null on failure).
Prompt for AI agents
Address the following comment on extensions/cli/src/util/git.test.ts at line 83:
<comment>Assertion is too weak and effectively tautological for a string | null return type; consider mocking git/execSync to assert specific outcomes (e.g., branch string in repo, null on failure).</comment>
<file context>
@@ -74,4 +74,13 @@ describe("git utilities - GitHub Actions detection", () => {
+ // Since we can't easily mock git commands in this test environment,
+ // we just test that the function returns either a string or null
+ const result = getGitBranch();
+ expect(typeof result === "string" || result === null).toBe(true);
+ });
+ });
</file context>
tingwai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch with checking screen width so we don't try to fit too much if its not wide enough
|
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Shows git branch if available
Prioritizes branch over owner/repo on smaller widths
CON-3746
Summary by cubic
Show the current git branch in the CLI status bar. On narrow terminals, the branch is prioritized over owner/repo; falls back to repo or cwd. Addresses CON-3746.
New Features
Refactors