Skip to content

fix: error when start-point is specified for existing branch or worktree#179

Merged
k1LoW merged 3 commits into
mainfrom
fix/error-on-start-point-with-existing-branch-or-worktree
Apr 17, 2026
Merged

fix: error when start-point is specified for existing branch or worktree#179
k1LoW merged 3 commits into
mainfrom
fix/error-on-start-point-with-existing-branch-or-worktree

Conversation

@k1LoW

@k1LoW k1LoW commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Return an error when start-point is specified but the target branch or worktree already exists, instead of silently ignoring it
  • Covers both direct usage (git wt existing-branch origin/main) and -b flag usage (git wt mydir -b existing-branch origin/main)
  • Updated E2E tests to verify the new error behavior (4 test cases)

Previously, start-point was silently ignored when the target branch or
worktree already existed. This could be confusing for users who expect
the worktree to be created from a specific start point.

Now git-wt returns a clear error in these cases:
- Switching to an existing worktree with a start-point
- Creating a worktree for an existing branch with a start-point

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (5695521) #179 (2a3334d) +/-
Coverage 38.4% 38.3% -0.2%
Code to Test Ratio 1:2.2 1:2.2 +0.0
Test Execution Time 19s 19s 0s
Details
  |                     | main (5695521) | #179 (2a3334d) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          38.4% |          38.3% | -0.2% |
  |   Files             |             13 |             13 |     0 |
  |   Lines             |           1169 |           1173 |    +4 |
  |   Covered           |            450 |            450 |     0 |
+ | Code to Test Ratio  |          1:2.2 |          1:2.2 |  +0.0 |
  |   Code              |           2482 |           2488 |    +6 |
+ |   Test              |           5637 |           5664 |   +27 |
  | Test Execution Time |            19s |            19s |    0s |

Code coverage of files in pull request scope (0.0% → 0.0%)

Files Coverage +/- Status
cmd/root.go 0.0% 0.0% modified

Reported by octocov

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k1LoW k1LoW merged commit f98cae4 into main Apr 17, 2026
7 checks passed
@k1LoW k1LoW deleted the fix/error-on-start-point-with-existing-branch-or-worktree branch April 17, 2026 12:48
@github-actions github-actions Bot mentioned this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants