commit 262f13b4eb8fbb7bec6782fa054817b271811354
parent 477472cf45d33988960ce3233f4edfe009562bbd
Author: Vincent Demeester <vincent@sbr.pm>
Date: Wed, 15 Sep 2021 16:24:18 +0200
users/vincent: assume main instead of master…
… and allow to override this using DEFAULT_BRANCH env variable.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/users/vincent/dev/mr/lib.mr b/users/vincent/dev/mr/lib.mr
@@ -27,13 +27,14 @@ git_gc = git gc "$@"
git_u =
git fetch -p --all
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+ DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
echo "On $CURRENT_BRANCH"
git stash
REMOTE="origin"
if [[ -z "$NO_UPSTREAM_U" ]]; then
git config remote.upstream.url && REMOTE="upstream"
fi
- echo "Rebase ${REMOTE}/master on master"
- git rebase ${REMOTE}/master master
+ echo "Rebase ${REMOTE}/${DEFAULT_BRANCH} on master"
+ git rebase ${REMOTE}/${DEFAULT_BRANCH} ${DEFAULT_BRANCH}
git co $CURRENT_BRANCH
skip = [ $1 != "checkout" ] && lazy