• A
    Git: Fixed error when staging in empty repository · 7b1a6c82
    Anirudh Rayabharam 提交于
    Trying to stage a commit in an empty repository (i.e. no prior commits)
    results in a git fatal error. This is because in an empty repo, HEAD
    doesn't point to anything causing `git ls-tree -l HEAD ...` to fail.
    
    To fix this, send `treeish` as `'HEAD'` to `getObjectDetails()` only if
    there is at least one commit in the repo. Else, send an empty string
    causing `getObjectDetails()` to use `lsFiles` instead of `lsTree`.
    
    Fixes #82026
    7b1a6c82
git.ts 47.9 KB