Repository navigation
fix: 같은 이름의 태그가 있어도 고른 브랜치로 diff한다 - #98
Merged
Merged
Conversation
피커에서 고른 base·head는 짧은 이름 그대로 git에 갔는데, git은 같은 이름이면 태그를 브랜치보다 먼저 해석한다. 경고가 stderr로 삼켜져 에러 없이 엉뚱한(대개 빈) diff가 나왔다. verifyBaseRef가 짧은 이름을 refs/heads/ → refs/remotes/ → 이름 그대로 순으로 전체 refname에 고정해 git에 넘긴다. auto base(resolveBaseRef)도 전체 refname을 쓴다. wire·URL·피커·툴바 표시는 짧은 이름 그대로라 기존 링크가 깨지지 않고, 브랜치가 아닌 태그·SHA·HEAD~1은 예전처럼 통과한다. Closes #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KpvgkrzKwuEHis6fKXgyPT
verifyBaseRef가 head를 전체 refname으로 고정하면서 /api/summary의 branch가 "refs/heads/feat"가 되어 카드가 "on refs/heads/feat"라고 적었다. 카드에는 사용자가 고른 이름을 따로 넘긴다. RepoSummary.ref 주석도 바뀐 모양에 맞춘다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KpvgkrzKwuEHis6fKXgyPT
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.
요약
Closes #73.
같은 이름의 브랜치와 태그가 함께 있으면 피커에서 브랜치를 골라도 git이 태그로 해석했다. 경고는 stderr로 삼켜져 에러 없이 엉뚱한(대개 빈) diff가 나왔다.
verifyBaseRef가 짧은 이름을refs/heads/<n>→refs/remotes/<n>→ 이름 그대로 순으로 전체 refname에 고정해 git에 넘긴다. base·head 두 축이 모두 이 함수를 지나므로 diff·summary·blob이 함께 고쳐진다.resolveBaseRef)도refs/remotes/origin/<n>·refs/heads/<n>을 쓴다(main이라는 태그가 있어도 기본 브랜치를 본다)..claude/rules/server.md에 계약과 회귀망을 적었다.이슈의 제안과 다르게 한 점
이슈는 wire에 전체 refname을 싣자고 했다. 하지만 두 축 모두
verifyBaseRef라는 한 지점을 지나 git에 닿으므로, 서버에서 고정하면 충분하다. 그래서:HEAD~1은 예전처럼 이름 그대로 git에 간다.tags/<n>나refs/tags/<n>로 적으면 된다(피커는 태그를 내놓지 않는다).테스트 계획
diff-server.test.ts"a branch and a tag with the same name": head·base·auto 세 축에서 태그를 브랜치와 다른 커밋에 붙인 픽스처. 구현 전에는 3개 모두 실패하는 것을 확인했고, 브랜치가 없는 태그는 그대로 풀리는 대조군도 있다bun run test:coverage: 933 pass, 100% 게이트 통과bun run typecheck·bun run lint·bun run format:check-접두 검사는 원래 값에 그대로 먼저 돌고, 접두가 붙은 값은refs/로 시작해 옵션이 될 수 없다🤖 Generated with Claude Code
https://claude.ai/code/session_01KpvgkrzKwuEHis6fKXgyPT