-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jk/clone-cmdline-config'
* jk/clone-cmdline-config: clone: accept config options on the command line config: make git_config_parse_parameter a public function remote: use new OPT_STRING_LIST parse-options: add OPT_STRING_LIST helper
- Loading branch information
Showing
10 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
test_description='tests for git clone -c key=value' | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'clone -c sets config in cloned repo' ' | ||
rm -rf child && | ||
git clone -c core.foo=bar . child && | ||
echo bar >expect && | ||
git --git-dir=child/.git config core.foo >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'clone -c can set multi-keys' ' | ||
rm -rf child && | ||
git clone -c core.foo=bar -c core.foo=baz . child && | ||
{ echo bar; echo baz; } >expect && | ||
git --git-dir=child/.git config --get-all core.foo >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'clone -c without a value is boolean true' ' | ||
rm -rf child && | ||
git clone -c core.foo . child && | ||
echo true >expect && | ||
git --git-dir=child/.git config --bool core.foo >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'clone -c config is available during clone' ' | ||
echo content >file && | ||
git add file && | ||
git commit -m one && | ||
rm -rf child && | ||
git clone -c core.autocrlf . child && | ||
printf "content\\r\\n" >expect && | ||
test_cmp expect child/file | ||
' | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters