diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-01-04 13:33:34 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-01-04 13:33:34 -0800 |
| commit | 84d178316fbe7e93b11e34604fcee86812802986 (patch) | |
| tree | 2c7794fad88516c97b1e6dee56c819088eb9be7d /t | |
| parent | Merge branch 'nd/checkout-dwim-fix' (diff) | |
| parent | Documentation/clone: document ignored configuration variables (diff) | |
| download | git-84d178316fbe7e93b11e34604fcee86812802986.tar.gz git-84d178316fbe7e93b11e34604fcee86812802986.zip | |
Merge branch 'sg/clone-initial-fetch-configuration'
Refspecs configured with "git -c var=val clone" did not propagate
to the resulting repository, which has been corrected.
* sg/clone-initial-fetch-configuration:
Documentation/clone: document ignored configuration variables
clone: respect additional configured fetch refspecs during initial fetch
clone: use a more appropriate variable name for the default refspec
Diffstat (limited to 't')
| -rwxr-xr-x | t/t5611-clone-config.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh index 39329eb7a8..60c1ba951b 100755 --- a/t/t5611-clone-config.sh +++ b/t/t5611-clone-config.sh @@ -45,6 +45,53 @@ test_expect_success 'clone -c config is available during clone' ' test_cmp expect child/file ' +test_expect_success 'clone -c remote.origin.fetch=<refspec> works' ' + rm -rf child && + git update-ref refs/grab/it refs/heads/master && + git update-ref refs/leave/out refs/heads/master && + git clone -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" . child && + git -C child for-each-ref --format="%(refname)" >actual && + + cat >expect <<-\EOF && + refs/grab/it + refs/heads/master + refs/remotes/origin/HEAD + refs/remotes/origin/master + EOF + test_cmp expect actual +' + +test_expect_success 'git -c remote.origin.fetch=<refspec> clone works' ' + rm -rf child && + git -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" clone . child && + git -C child for-each-ref --format="%(refname)" >actual && + + cat >expect <<-\EOF && + refs/grab/it + refs/heads/master + refs/remotes/origin/HEAD + refs/remotes/origin/master + EOF + test_cmp expect actual +' + +test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' ' + rm -rf child && + git clone --origin=upstream \ + -c "remote.upstream.fetch=+refs/grab/*:refs/grab/*" \ + -c "remote.origin.fetch=+refs/leave/*:refs/leave/*" \ + . child && + git -C child for-each-ref --format="%(refname)" >actual && + + cat >expect <<-\EOF && + refs/grab/it + refs/heads/master + refs/remotes/upstream/HEAD + refs/remotes/upstream/master + EOF + test_cmp expect actual +' + # Tests for the hidden file attribute on windows is_hidden () { # Use the output of `attrib`, ignore the absolute path |
