Skip to content
Snippets Groups Projects
Commit 44f167bd authored by Owen Arnold's avatar Owen Arnold
Browse files

Merge pull request #154 from mantidproject/11002_branch_prefix_git_macros

Default to blank prefix on "git new"
parents 7265066d 10954619
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@
# Set top-level command name
CMD_NAME="new"
# Prefix for branch names
DEFAULT_PREFIX="feature/"
DEFAULT_PREFIX=""
# Base branch for new branches
BASE_BRANCH="origin/master"
......@@ -56,7 +56,7 @@ usage() {
echo "Switches:"
echo " -h Prints this help"
echo " -p When creating a branch use this prefix in the"
echo " name (default=feature/)"
echo " name (default=BLANK)"
echo " -s Stash any local changes before switching to the new branch"
echo " and unstash them once the switch has occurred"
}
......@@ -107,10 +107,12 @@ get_opts() {
exit 1
fi
# Make sure the prefix ends with a / by removing it
# if it exists and adding it back
BRANCH_PREFIX=${BRANCH_PREFIX%%"/"}
BRANCH_PREFIX=${BRANCH_PREFIX}"/"
if [ ! -z "${BRANCH_PREFIX}" ]; then
# Make sure the prefix ends with a / by removing it
# if it exists and adding it back
BRANCH_PREFIX=${BRANCH_PREFIX%%"/"}
BRANCH_PREFIX=${BRANCH_PREFIX}"/"
fi
}
main() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment