Commit c1951892 authored by Victor Torres's avatar Victor Torres Committed by Marc Cornellà
Browse files

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: default avatarMarc Cornellà <marc.cornella@live.com>
parent 73cca943
......@@ -16,8 +16,13 @@ function branch_prompt_info() {
fi
# Mercurial repository
if [[ -d "${current_dir}/.hg" ]]
then
if [[ -f "$current_dir/.hg/branch" ]]
then
echo '☿' $(<"$current_dir/.hg/branch")
else
echo '☿ default'
fi
return;
fi
# Defines path as parent directory and keeps looking for :)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment