You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 3, 2025. It is now read-only.
When attempting to run ai-diff-commit, an error occurs related to the HEAD argument in Git. The following error is displayed:
fatal:ambiguousargument'HEAD': unknown revision or path not in the working tree.Use'--' to separate paths from revisions, like this:'git <command> [<revision>...] -- [<file>...]'Anerroroccurred:Error:Commandfailed:gitrev-parse--abbrev-refHEADfatal:ambiguousargument'HEAD': unknown revision or path not in the working tree.
The error seems to arise from a failure in the command git rev-parse --abbrev-ref HEAD, which is used to identify the current Git branch. This may happen if the repository is in a detached HEAD state or if there are no commits in the repository.
Steps to Reproduce:
Run ai-diff-commit in a directory with a Git repository in a detached HEAD state or without any commits.
Expected Behavior: The tool should handle this scenario gracefully, possibly with a message indicating that a valid branch could not be detected.
Environment Details:
OS: Windows
Node Version: 20.18.0
ai-diff-commit version: 0.0.3
Additional Context: The error traceback points to the getCurrentBranchName function in git.js. A potential fix could include handling scenarios where HEAD is ambiguous or ensuring the repository has a valid branch checked out.