Commit 58995b5b authored by Vincent Driessen's avatar Vincent Driessen

Include a globally available variable GIT_DIR, that points to the .git directory.

Add a function that tests whether a specific commit is already merged into the given target branch.
parent 17a8112b
......@@ -18,6 +18,7 @@ if [ "$DEBUG" = "yes" ]; then
set -x
fi
export GIT_DIR=$(git rev-parse --git-dir)
export GITFLOW_DIR=$(dirname "$0")
export MASTER_BRANCH=$(git config --get gitflow.branch.master || echo master)
export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop || echo develop)
......@@ -162,4 +163,16 @@ gitflow_require_branches_equal() {
fi
}
#
# gitflow_is_branch_merged_into()
#
# Checks whether branch $1 is succesfully merged into $2
#
gitflow_is_branch_merged_into() {
local SUBJECT=$1
local BASE=$2
ALL_MERGES=$(git branch --contains $SUBJECT | sed 's/^[* ] //')
has $BASE $ALL_MERGES
}
main "$@"
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