+++ /dev/null
-#!/bin/sh
-
-# $1 = previous hash
-# $2 = new hash (could be the same)
-# $3 = flag (0=retreiving from index, 1=new checkout)
-
-branch=$(git symbolic-ref --quiet HEAD)
-if [[ $? -ne 0 ]] ; then
- exit 0
-fi
-
-branch=${branch/refs\/heads\//}
-
-rebase=$(git config "branch.${branch}.rebase")
-if [ $? -ne 0 ] ; then
- git config "branch.${branch}.rebase" "true"
-fi
-
-merge=$(git config "branch.${branch}.merge")
-remote=$(git config "branch.${branch}.remote")
-if [ "$branch" != "stable" -a "$remote" == "origin" -a "$merge" == "refs/heads/stable" ] ; then
- git config "branch.${branch}.merge" "refs/heads/${branch}"
-fi
-
-exit 0
-
+++ /dev/null
-#!/bin/sh
-
-test_description='client checkout auto-set branch rebase=true'
-
-. ./test-lib.sh
-
-test_expect_success 'setup' '
- echo "setup" >file &&
- git add file &&
- git commit -m "setup" &&
- git clone . ./server &&
- git remote add origin ./server &&
- git config branch.master.remote origin &&
- git config branch.master.merge refs/heads/master
-'
-
-# setup the post-checkout hook
-install_post_checkout_hook 'post-checkout-rebase'
-
-test_expect_success 'sets rebase on new topic branch' '
- ! git config --list | grep branch.master.rebase &&
- git checkout -b topic master &&
- git config --list | grep branch.topic.rebase=true
-'
-
-test_expect_success 'checking out remote branch does nothing' '
- git push origin topic:topic2 &&
- git fetch &&
- git checkout origin/topic2 &&
- ! git config --list | grep "branch..rebase"
-'
-
-test_expect_success 'cloning stable sets up the correct merge' '
- git push origin topic:stable &&
- git fetch &&
- git checkout -b topic3 origin/stable &&
- test "refs/heads/topic3" = "$(git config branch.topic3.merge)"
-'
-
-test_done
-