#!/bin/bash

# gitmk-inherit -- inherit the auxiliary branches for GOAL from branch BASE.

# (To think over: do we care about possibly renaming the GOAL?)

set -e # exit on any error immediately!

readonly GOAL="$1"
readonly BASE="$2"

readonly headref="$(git symbolic-ref HEAD)"
readonly BRANCH="${headref##refs/heads/}"

set -x

git branch "$BRANCH"_/AUTO/"$GOAL" "$BASE"_/AUTO/"$GOAL"
git branch "$BRANCH"_/OUT/"$GOAL" "$BASE"_/OUT/"$GOAL"
