Git: Fixed error when staging in empty repository
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
Showing
想要评论请 注册 或 登录