Skip to content

Fix default directory in git init - #208

Open
ianthomas23 wants to merge 1 commit into
QuantStack:mainfrom
ianthomas23:fix-init-directory
Open

ianthomas23 wants to merge 1 commit into
QuantStack:mainfrom
ianthomas23:fix-init-directory

Conversation

@ianthomas23

Copy link
Copy Markdown
Member

git2cpp init --help currently shows the working directory:

$ git2cpp init --help
Create an empty Git repository or reinitialize an existing one


./git2cpp init [OPTIONS] [directory]


POSITIONALS:
  directory TEXT:(DIR) OR (PATH(non-existing)) [/Users/iant/github/git2cpp/build]
                              Directory to create the repository in, created if it does not
                              exist. Defaults to the current directory.
<snip>

It should not do this, the statement about 'Defaults to the current directory' is sufficient. The solution is to avoid use of CLI11's default_val which runs when the subcommand is constructed and instead determine it when the subcommand is run. With this PR:

$ git2cpp init --help
Create an empty Git repository or reinitialize an existing one


./build/git2cpp init [OPTIONS] [directory]


POSITIONALS:
  directory TEXT:(DIR) OR (PATH(non-existing))
                              Directory to create the repository in, created if it does not
                              exist. Defaults to the current directory.
<snip>

Fixes #206.

@ianthomas23 ianthomas23 added the bug Something isn't working label Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (22780bc) to head (f4d6839).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #208      +/-   ##
==========================================
- Coverage   88.35%   86.80%   -1.56%     
==========================================
  Files          64       64              
  Lines        3075     3076       +1     
  Branches      376      376              
==========================================
- Hits         2717     2670      -47     
- Misses        358      406      +48     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Executable path shown in docs

1 participant