V4 to V5 Bench Update Error

I have V4 installed and got these errors while trying to update to V5.
Can’t understand if it is related to Git or Bench. Please help.

[root@localhost frappe-bench]# bench update
Already up-to-date.
remote: Counting objects: 116, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 116 (delta 58), reused 18 (delta 16), pack-reused 7
Receiving objects: 100% (116/116), 33.27 KiB | 0 bytes/s, done.
Resolving deltas: 100% (58/58), completed with 16 local objects.
From https://github.com/frappe/frappe
1935742…c8f9c6d develop -> upstream/develop
a7992a2…c8f9c6d master -> upstream/master

  • [new tag] v5.0.22 -> v5.0.22
    From https://github.com/frappe/frappe
  • [new tag] v5.0.20 -> v5.0.20
  • [new tag] v5.0.21 -> v5.0.21
    Traceback (most recent call last):
    File “/usr/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 56, in cli
    bench()
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 664, in call
    return self.main(*args, **kwargs)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 644, in main
    rv = self.invoke(ctx)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/cli.py”, line 221, in update
    version_upgrade = is_version_upgrade()
    File “/home/frappe/bench-repo/bench/app.py”, line 98, in is_version_upgrade
    upstream_version = get_upstream_version(frappe_dir, branch=branch)
    File “/home/frappe/bench-repo/bench/app.py”, line 131, in get_upstream_version
    branch = get_current_branch(repo_dir)
    File “/home/frappe/bench-repo/bench/app.py”, line 120, in get_current_branch
    return get_cmd_output(“basename $(git symbolic-ref -q HEAD)”, cwd=repo_dir)
    File “/home/frappe/bench-repo/bench/utils.py”, line 257, in get_cmd_output
    return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, ‘wb’)).strip()
    File “/usr/lib64/python2.7/subprocess.py”, line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command ‘basename $(git symbolic-ref -q HEAD)’ returned non-zero exit status 1