Git fork

Merge branch 'js/t7500-pwd-windows-fix'

Test fix.

* js/t7500-pwd-windows-fix:
t7500: fix tests with absolute path following ":(optional)" on Windows

+14 -5
+14 -5
t/t7500-commit-template-squash-signoff.sh
··· 33 33 ( 34 34 GIT_EDITOR="echo hello >" && 35 35 export GIT_EDITOR && 36 - test_must_fail git commit --template "$PWD"/notexist 36 + test_must_fail git commit --template "$(pwd)"/notexist 37 37 ) 38 38 ' 39 39 ··· 43 43 ( 44 44 GIT_EDITOR="echo hello >\"\$1\"" && 45 45 export GIT_EDITOR && 46 - git commit --template ":(optional)$PWD/notexist" 46 + git commit --template ":(optional)$(pwd)/notexist" 47 47 ) 48 48 ' 49 49 50 50 test_expect_success 'nonexistent template file in config should return error' ' 51 - test_config commit.template "$PWD"/notexist && 51 + test_config commit.template "$(pwd)"/notexist && 52 52 ( 53 53 GIT_EDITOR="echo hello >" && 54 54 export GIT_EDITOR && ··· 57 57 ' 58 58 59 59 test_expect_success 'nonexistent optional template file in config' ' 60 - test_config commit.template ":(optional)$PWD"/notexist && 60 + test_config commit.template ":(optional)$(pwd)"/notexist && 61 61 GIT_EDITOR="echo hello >" git commit --allow-empty && 62 62 git cat-file commit HEAD | sed -e "1,/^$/d" >actual && 63 63 echo hello >expect && ··· 65 65 ' 66 66 67 67 # From now on we'll use a template file that exists. 68 - TEMPLATE="$PWD"/template 68 + TEMPLATE="$(pwd)"/template 69 69 70 70 test_expect_success 'unedited template should not commit' ' 71 71 echo "template line" >"$TEMPLATE" && ··· 97 97 git commit --allow-empty --template "$TEMPLATE" 98 98 ) && 99 99 commit_msg_is "template linecommit message" 100 + ' 101 + 102 + test_expect_success 'existent template marked optional should commit' ' 103 + echo "existent template" >"$TEMPLATE" && 104 + ( 105 + test_set_editor "$TEST_DIRECTORY"/t7500/add-content && 106 + git commit --allow-empty --template ":(optional)$TEMPLATE" 107 + ) && 108 + commit_msg_is "existent templatecommit message" 100 109 ' 101 110 102 111 test_expect_success '-t option should be short for --template' '