Skip to content

fix(bench): incorrect opening method in @napi-rs/simple-git repository#120

Merged
seokju-na merged 1 commit intotoss:mainfrom
other-yuka:simple-git
Apr 26, 2025
Merged

fix(bench): incorrect opening method in @napi-rs/simple-git repository#120
seokju-na merged 1 commit intotoss:mainfrom
other-yuka:simple-git

Conversation

@other-yuka
Copy link
Contributor

Description

This PR corrects the method used to open an existing repository in the benchmark code (benchmarks/index.bench.ts) for @napi-rs/simple-git.

Problem

The benchmark test for opening a repository in @napi-rs/simple-git was incorrectly using the SimpleGitRepository.init(gitDir) method. This method initializes a new repository, whereas the benchmark should be testing the opening of an existing repository. This usage contradicts the intended functionality documented in the library.

According to the library documentation:

  • Repository.init('/path/to/repo'): Initializes a new Git repository at the specified path.
  • new Repository('/path/to/repo'): Opens an existing repository.

In the context of this benchmark, the goal is to measure the performance of opening a pre-existing repository. Therefore, the use of init was incorrect.

Solution

The benchmark code has been updated to use the correct method for opening an existing repository, which is the constructor call: new SimpleGitRepository(gitDir).

Expected Outcome

This correction ensures that the benchmark for the repository opening feature of @napi-rs/simple-git accurately reflects the correct usage pattern of the library.

@other-yuka other-yuka requested a review from seokju-na as a code owner April 26, 2025 13:39
@vercel
Copy link

vercel bot commented Apr 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
es-git ⬜️ Skipped (Inspect) Apr 26, 2025 1:39pm

@seokju-na seokju-na merged commit 802dab2 into toss:main Apr 26, 2025
27 checks passed
@other-yuka other-yuka deleted the simple-git branch April 26, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants