Skip to content
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

Refactor and add tests for git package #4927

Merged
merged 4 commits into from
May 29, 2024
Merged

Refactor and add tests for git package #4927

merged 4 commits into from
May 29, 2024

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented May 29, 2024

What this PR does / why we need it:

This PR does four things to improve git package.

  1. adds test for repository copy method.
  2. remove unused private method getLatestRemoteHashForBranch from git client
  3. fix the variable used in test because it seems typo
  4. test not private method but its exported wrapper method

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?: No

  • How are users affected by this change: N/A
  • Is this breaking change: N/A
  • How to migrate (if breaking change): N/A

Signed-off-by: Shinnosuke Sawada <6warashi9@gmail.com>
Signed-off-by: Shinnosuke Sawada <6warashi9@gmail.com>
Signed-off-by: Shinnosuke Sawada <6warashi9@gmail.com>
Signed-off-by: Shinnosuke Sawada <6warashi9@gmail.com>
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.39%. Comparing base (89fba60) to head (b830e1a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4927      +/-   ##
==========================================
+ Coverage   29.32%   29.39%   +0.07%     
==========================================
  Files         321      322       +1     
  Lines       40835    40852      +17     
==========================================
+ Hits        11974    12010      +36     
+ Misses      27904    27882      -22     
- Partials      957      960       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Thank you!! What a clear commit log!

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

Thank you!

@t-kikuc t-kikuc merged commit 9bf5c33 into master May 29, 2024
14 checks passed
@t-kikuc t-kikuc deleted the add-test-for-pkg-git branch May 29, 2024 05:26
@@ -206,7 +206,7 @@ func Test_setGCAutoDetach(t *testing.T) {
}

getGCAutoDetach := func(ctx context.Context, repo *repo) (bool, error) {
cmd := exec.CommandContext(ctx, r.gitPath, "config", "--get", "gc.autoDetach")
cmd := exec.CommandContext(ctx, repo.gitPath, "config", "--get", "gc.autoDetach")
Copy link
Member

Choose a reason for hiding this comment

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

@Warashi Sorry for the late comment, look like the r variable in the below line (L210) has the same issue with this fixed one. It works because both refer to the outer r variable 👀 Would be great if you could open another PR to fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened another PR to fix this with other improvements.
#4932

@github-actions github-actions bot mentioned this pull request Jun 12, 2024
@github-actions github-actions bot mentioned this pull request Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants