mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Use default branch on recently created Mercurial repository. (#4985)
After `hg init` command, sometimes Mercurial does not create `.hg/branch` file so we'll use 'default' as fallback, which is the master branch in Mercurial repositories. Signed-off-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
parent
73cca94322
commit
c195189231
1 changed files with 6 additions and 1 deletions
|
@ -16,8 +16,13 @@ function branch_prompt_info() {
|
||||||
fi
|
fi
|
||||||
# Mercurial repository
|
# Mercurial repository
|
||||||
if [[ -d "${current_dir}/.hg" ]]
|
if [[ -d "${current_dir}/.hg" ]]
|
||||||
|
then
|
||||||
|
if [[ -f "$current_dir/.hg/branch" ]]
|
||||||
then
|
then
|
||||||
echo '☿' $(<"$current_dir/.hg/branch")
|
echo '☿' $(<"$current_dir/.hg/branch")
|
||||||
|
else
|
||||||
|
echo '☿ default'
|
||||||
|
fi
|
||||||
return;
|
return;
|
||||||
fi
|
fi
|
||||||
# Defines path as parent directory and keeps looking for :)
|
# Defines path as parent directory and keeps looking for :)
|
||||||
|
|
Loading…
Reference in a new issue