Have pull requests close linked issues and preserve branch issue links #66
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
state: Done
state: New
state: To Do
type: Bug
type: Feature
type: Task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Christoph/Gitty!66
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-pr-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change adds support for closing an issue from a pull request when the source branch was created from that issue, surfaces linked-issue metadata in the Branch panel, and includes a few related fixes in the Git/Tauri code.
Summary of changes and observable behavior:
Pull request behavior
Closes #<number>appended viaappendIssueCloseReference.appendIssueCloseReferenceto modify the description when requested.src/lib/issueBranch.ts:issueCloseReference,appendIssueCloseReference,issueLinkMatchesRepository,readBranchIssueLinks, andmoveBranchIssueLink. These implement the closing-reference logic, repository-scoped link matching, and link migration when a branch is renamed.Branch UI and link persistence
App.sveltenow reads all branch issue links (readBranchIssueLinks) intobranchIssueLinksand passes them toBranchPanelas theissueLinksprop.BranchPanel.sveltedisplays the issue number in the branch list and shows#<number> <title>in the branch tooltip/title when a branch is linked.moveBranchIssueLinkis called fromApp.svelteto preserve the link; the function returns whether the move succeeded.Tests
scripts/issue-branch.test.mjswas added to cover the append/match/move/read/write behaviors for branch issue links.Git/Tauri fixes
src-tauri/src/git/lfs.rs: before runninggit lfs pull, the code now runsgit lfs install --local --skip-repowhen repository-local LFS filters are not configured. This avoids leaving LFS pointer files behind when Git LFS is not installed globally and prevents modifying existing repo hooks.src-tauri/src/git/review_cleanup.rs: the cleanup now checks whether the remote-tracking ref exists before callinggit update-ref -d .... This avoids an error path when newer Git versions already removed the remote-tracking branch during the push.Testing
Recommended focused checks for reviewers
writeBranchIssueLinkin the console for the repo), open the Create Pull Request dialog:Closes #<number>accordingly.#<number>badge and the tooltip includes#<number> <title>.scripts/issue-branch.test.mjsvia the project test runner (Node.jsnode:test) to exercise the new helpers.git lfs install, perform apull_git_lfs_objectsflow and verify pointer files are not left behind and that repository-local filters are configured without touching existing hooks.update-refwhen the tracking ref is already gone.Compatibility and risks
localStorage. Link operations catch storage errors and fail gracefully;moveBranchIssueLinkreturnsfalseon error.CreateReviewDialog.svelte,App.svelteandBranchPanel.svelte, and the new helpers insrc/lib/issueBranch.ts. Also review the Tauri native changes insrc-tauri/src/git/lfs.rsandsrc-tauri/src/git/review_cleanup.rsfor potential platform-specific side effects.If you want, I can extract the new helper functions into a separate file for easier testing, or add integration tests that exercise the full PR creation flow with a test integration backend.