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

Panic on git branchless init in a non-git directory #1069

Open
dragon-dxw opened this issue Sep 21, 2023 · 0 comments · May be fixed by #1097
Open

Panic on git branchless init in a non-git directory #1069

dragon-dxw opened this issue Sep 21, 2023 · 0 comments · May be fixed by #1097
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dragon-dxw
Copy link

Description of the bug

First time using git branchless, I accidently ran the command in the parent folder of my git repos, rather than in a git repo.

I did not expect an uncaught panic.

Expected behavior

A polite error message informing me of the mistake I'd made.

Actual behavior

A panic.

The application panicked (crashed).
Message:  A fatal error occurred: 
   0: could not open repository: could not find repository from '/Users/dragon/dxw/archives'; class=Repository (6); code=NotFound (-3)
   1: could not find repository from '/Users/dragon/dxw/archives'; class=Repository (6); code=NotFound (-3)

Location:
   git-branchless-init/src/lib.rs:606

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: git_branchless_init::command_init with effects=<Output fancy=true> git_run_info=<GitRunInfo path_to_git="git" working_directory="/Users/dragon/dxw/archives" env=not shown> main_branch_name=None
      at git-branchless-init/src/lib.rs:599
   1: git_branchless_init::command_main with ctx=CommandContext { effects: <Output fancy=true>, git_run_info: <GitRunInfo path_to_git="git" working_directory="/Users/dragon/dxw/archives" env=not shown> } args=InitArgs { uninstall: false, main_branch_name: None }
      at git-branchless-init/src/lib.rs:668

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Location: git-branchless/src/commands/mod.rs:235

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

git version 2.42.0

@dragon-dxw dragon-dxw added the bug Something isn't working label Sep 21, 2023
@arxanas arxanas added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 22, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 10, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 10, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants