tests: factor HOME=$(pwd) in test-lib.sh
[git.git] / t / t5601-clone.sh
index 678cee502de54e5a9c18a43f114446d3392ec7f3..8617965ec05d7d8789bcc455011650ad76cc7f2a 100755 (executable)
@@ -163,8 +163,6 @@ test_expect_success 'clone a void' '
 
 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 &&
@@ -176,4 +174,16 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
        )
 '
 
+test_expect_success 'respect url-encoding of file://' '
+       git init x+y &&
+       test_must_fail git clone "file://$PWD/x+y" xy-url &&
+       git clone "file://$PWD/x%2By" xy-url
+'
+
+test_expect_success 'do not respect url-encoding of non-url path' '
+       git init x+y &&
+       test_must_fail git clone x%2By xy-regular &&
+       git clone x+y xy-regular
+'
+
 test_done