aboutsummaryrefslogtreecommitdiff
path: root/t/t5601-clone.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-03 22:29:55 -0800
committerJunio C Hamano <gitster@pobox.com>2009-03-03 22:58:52 -0800
commita9f2c13685ae9040d52d53cd719a18040f1dd123 (patch)
treef3d1738b9c775468fedac43d62d3289cbebf0fd6 /t/t5601-clone.sh
parenta1070d4cbbf1002cc0b01afc3de06382deb0511a (diff)
downloadgit-a9f2c13685ae9040d52d53cd719a18040f1dd123.tar.gz
git-a9f2c13685ae9040d52d53cd719a18040f1dd123.tar.xz
Make git-clone respect branch.autosetuprebase
When git-clone creates an initial branch it was not checking the branch.autosetuprebase configuration option (which may exist in ~/.gitconfig). Refactor the code used by "git branch" to create a new branch, and use it instead of the insufficiently duplicated code in builtin-clone. Changes are partly, and the test is mostly, based on the previous work by Pat Notz. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5601-clone.sh')
-rwxr-xr-xt/t5601-clone.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 44793f2ee..2335d8bc8 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -159,4 +159,19 @@ test_expect_success 'clone a void' '
test_cmp target-6/.git/config target-7/.git/config
'
+test_expect_success 'clone respects global branch.autosetuprebase' '
+ (
+ HOME=$(pwd) &&
+ export HOME &&
+ test_config="$HOME/.gitconfig" &&
+ unset GIT_CONFIG_NOGLOBAL &&
+ git config -f "$test_config" branch.autosetuprebase remote &&
+ rm -fr dst &&
+ git clone src dst &&
+ cd dst &&
+ actual="z$(git config branch.master.rebase)" &&
+ test ztrue = $actual
+ )
+'
+
test_done