Fix git head on older git

Not all git has `--short` for `symbolic-ref`
Merge branch 'fix_head_in_older_git'