t / t5708-clone-config.shon commit Merge branch 'rt/for-each-ref-spell-tcl-as-Tcl' (a558344)
   1#!/bin/sh
   2
   3test_description='tests for git clone -c key=value'
   4. ./test-lib.sh
   5
   6test_expect_success 'clone -c sets config in cloned repo' '
   7        rm -rf child &&
   8        git clone -c core.foo=bar . child &&
   9        echo bar >expect &&
  10        git --git-dir=child/.git config core.foo >actual &&
  11        test_cmp expect actual
  12'
  13
  14test_expect_success 'clone -c can set multi-keys' '
  15        rm -rf child &&
  16        git clone -c core.foo=bar -c core.foo=baz . child &&
  17        { echo bar; echo baz; } >expect &&
  18        git --git-dir=child/.git config --get-all core.foo >actual &&
  19        test_cmp expect actual
  20'
  21
  22test_expect_success 'clone -c without a value is boolean true' '
  23        rm -rf child &&
  24        git clone -c core.foo . child &&
  25        echo true >expect &&
  26        git --git-dir=child/.git config --bool core.foo >actual &&
  27        test_cmp expect actual
  28'
  29
  30test_expect_success 'clone -c config is available during clone' '
  31        echo content >file &&
  32        git add file &&
  33        git commit -m one &&
  34        rm -rf child &&
  35        git clone -c core.autocrlf . child &&
  36        printf "content\\r\\n" >expect &&
  37        test_cmp expect child/file
  38'
  39
  40test_done