Skip to content

Commit

Permalink
Detect when we are in the middle of a merge, rebase or cherry-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
joeytwiddle committed Apr 4, 2016
1 parent 2607539 commit 1c87a4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ find_git_branch() {
#branch=$(git rev-parse HEAD 2> /dev/null)
fi
fi
local git_dir="$(git rev-parse --show-toplevel)/.git"
if [[ -d "$git_dir/rebase-merge" ]]; then
branch="$branch>rebase"
elif [[ -f "$git_dir/MERGE_HEAD" ]]; then
branch="$branch>merge"
elif [[ -f "$git_dir/CHERRY_PICK_HEAD" ]]; then
branch="$branch>pick"
fi
git_branch=" [$branch]"
else
git_branch=""
Expand Down

2 comments on commit 1c87a4b

@joeytwiddle
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeweilgart This may interest you.

@mikeweilgart
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, thanks! I think this is code we should incorporate in jimeh#33, assuming you like the idea of participating in a rewrite?

Please sign in to comment.