update-bash: fix git_init_if_necessary
* Make sure `.git` directory be deleted at any error. So we won't have a
stale setup.
* Run `git fetch` and `git reset` when initialize git in the first time.
Otherwise, we will get error and merging problem afterwards.
Closes Homebrew/homebrew#48509.
Signed-off-by:
Xu Cheng <xucheng@me.com>
Please register or sign in to comment