The new flag '-d' lets you delete a branch. For safety, it does not
lets you delete the branch you are currently on, nor a branch that
has been fully merged into your current branch.
The credit for the safety check idea goes to Daniel Barkalow.
Signed-off-by: Junio C Hamano <junkio@cox.net>
If no arguments, show available branches and mark current branch with a star.
If one argument, create a new branch <branchname> based off of current HEAD.
@ -12,6 +12,59 @@ If two arguments, create a new branch <branchname> based off of <start-point>.
@@ -12,6 +12,59 @@ If two arguments, create a new branch <branchname> based off of <start-point>.
exit 1
}
delete_branch () {
option="$1" branch_name="$2"
headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')