nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Bug Report | `git status` subcommand displays an error when running on a new Git branch or repository

Open JosephLai241 opened this issue 1 year ago • 0 comments

Describe The Bug

The nd git status subcommand should usually display some branch information on top of the tree containing changed files. Running this command on a new branch or a new repository will display an error instead of the branch information.

Expected Behavior

This subcommand should successfully display branch information and upstream branch information, if applicable.

Actual Behavior

An error message appears in lieu of the branch information.

Steps To Reproduce

  • git checkout a new branch or create a new Git repository locally.
  • Run nd git status.
    • An error should be displayed on top of the tree containing changed files.

Traceback/Output

Could not get repository HEAD!

# The Git status tree is displayed here.
# ...
# ...
# ...

Additional Context

I need to revisit the git2 crate and figure out a different way, or perhaps how to handle different conditions, to go about extracting branch and upstream branch information from a Git repository.

JosephLai241 avatar Aug 24 '22 16:08 JosephLai241