Summary
When t3code opens a repository that has been initialized with Git but does not have any commits yet, the VCS remote status refresh can fail repeatedly while trying to read the current branch.
Reproduction
- Create or open a directory.
- Initialize it as a Git repository.
- Do not create an initial commit.
- Open the directory in t3code and wait for the VCS remote status refresh.
Actual behavior
t3code logs repeated warnings from GitVcsDriver.statusDetailsRemote.branch because git rev-parse --abbrev-ref HEAD can fail in an unborn repository:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Expected behavior
The VCS remote status refresh should treat the repository as a valid Git repository on its current unborn branch, report no upstream/ahead/behind state, and avoid repeated warning logs.
Notes
git symbolic-ref --quiet --short HEAD works for unborn branches because Git still has a symbolic HEAD pointing at the current branch name before the first commit. Detached HEAD can continue to be handled separately.
Summary
When t3code opens a repository that has been initialized with Git but does not have any commits yet, the VCS remote status refresh can fail repeatedly while trying to read the current branch.
Reproduction
Actual behavior
t3code logs repeated warnings from GitVcsDriver.statusDetailsRemote.branch because git rev-parse --abbrev-ref HEAD can fail in an unborn repository:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Expected behavior
The VCS remote status refresh should treat the repository as a valid Git repository on its current unborn branch, report no upstream/ahead/behind state, and avoid repeated warning logs.
Notes
git symbolic-ref --quiet --short HEAD works for unborn branches because Git still has a symbolic HEAD pointing at the current branch name before the first commit. Detached HEAD can continue to be handled separately.