Skip to content

디폴트 브랜치 요청 처리#77

Merged
reddevilmidzy merged 1 commit intomainfrom
default-branch
May 26, 2025
Merged

디폴트 브랜치 요청 처리#77
reddevilmidzy merged 1 commit intomainfrom
default-branch

Conversation

@reddevilmidzy
Copy link
Owner

@reddevilmidzy reddevilmidzy commented May 26, 2025

♟️ What’s this PR about?

branch 이름으로 None을 주었을 때 default 브랜치를 찾지 못하던 문제를 해결하였습니다.
원인은 schedule 에서 지맘대로 None을 "default"로 바꾼다음 git 모듈에게 넘겨준게 문제였습니다.

schedule의 RepoKey 필드를 branch: String 에서 branch: Option으로 변경하고 코드 리팩터링을 하였습니다.

🔗 Related Issues / PRs

close: #76

Copilot AI review requested due to automatic review settings May 26, 2025 08:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@reddevilmidzy reddevilmidzy requested a review from Copilot May 26, 2025 08:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue where providing None as the branch caused the default branch not to be found by refactoring how branch data is handled.

  • Updated RepoKey to use an Option for branch
  • Removed local defaulting of branch in schedule functions and adjusted logging messages
  • Modified git module functions to accept branch as an Option and updated branch checkout logic

Reviewed Changes

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

File Description
rook/src/schedule/mod.rs Converted branch to Option and removed forced defaulting of branch.
rook/src/git/mod.rs Updated functions to handle branch as an Option and refactored checkout logic.
Comments suppressed due to low confidence (3)

rook/src/schedule/mod.rs:24

  • Removing the default branch conversion here shifts its responsibility to downstream functions. Verify that this behavior is consistent and that the git module correctly defaults to 'default' when branch is None.
let branch = branch.unwrap_or_else(|| "default".to_string());

rook/src/schedule/mod.rs:13

  • The change to use an Option type for the branch field in RepoKey is a good design move for handling None values. Please ensure that all related components (e.g., hash map keys) correctly handle cases when branch is None.
branch: Option<String>,

rook/src/git/mod.rs:59

  • The updated checkout_branch function now directly checks out the commit tree and sets the HEAD without creating a local tracking branch. Confirm that this behavior aligns with the intended branch tracking requirements.
repo.checkout_tree(commit.as_object(), None)?;

@reddevilmidzy reddevilmidzy merged commit 03a226d into main May 26, 2025
2 checks passed
@reddevilmidzy reddevilmidzy deleted the default-branch branch May 26, 2025 08:24
@reddevilmidzy reddevilmidzy added this to the 3차 MVP 구현 milestone Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

디폴트 브랜치를 찾지 못함

2 participants