[Fix](version) Fix unknown doris version when build in git worktree directory (#62935)

In worktree dir, `.git` is not a directory but a file.
before:
```
Version: doris-0.0.0-Unknown
```

now:
```
Version: doris-0.0.0-1f18be0330e
```
This commit is contained in:
zclllyybb authored and GitHub committed 2026-04-29 15:22:38 +08:00
1 parent 430781b129
commit c31c82fc7f
1 file changed
+1 -1
+1 -1
View File
@@ -67,7 +67,7 @@ fi
cd "${DORIS_HOME}"
if [[ -d '.git' ]]; then
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
revision="$(git log -1 --pretty=format:"%H")"
short_revision="$(git log -1 --pretty=format:"%h")"
url="git://${hostname}"