diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-04 12:36:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-04 12:36:47 -0700 |
commit | baa8d42f0508f0854a83b068c7f6ca227b143d38 (patch) | |
tree | 781d6698151e12503f32cd251792e350201a69d1 /t | |
parent | 7216b1fb5c8c702a2ce3ca84febce570480e50f6 (diff) | |
parent | a4889e64bf4bf52994923a5bd59092a47bdbc3c6 (diff) | |
download | git-baa8d42f0508f0854a83b068c7f6ca227b143d38.tar.gz git-baa8d42f0508f0854a83b068c7f6ca227b143d38.tar.xz |
Merge branch 'sg/bash-prompt-lf-in-cwd-test'
* sg/bash-prompt-lf-in-cwd-test:
bash prompt: test the prompt with newline in repository path
Diffstat (limited to 't')
-rwxr-xr-x | t/t9903-bash-prompt.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 3c3e4e8c3..59f875e83 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @@ -61,6 +61,29 @@ test_expect_success 'prompt - unborn branch' ' test_cmp expected "$actual" ' +repo_with_newline='repo +with +newline' + +if mkdir "$repo_with_newline" 2>/dev/null +then + test_set_prereq FUNNYNAMES +else + say 'Your filesystem does not allow newlines in filenames.' +fi + +test_expect_success FUNNYNAMES 'prompt - with newline in path' ' + printf " (master)" >expected && + git init "$repo_with_newline" && + test_when_finished "rm -rf \"$repo_with_newline\"" && + mkdir "$repo_with_newline"/subdir && + ( + cd "$repo_with_newline/subdir" && + __git_ps1 >"$actual" + ) && + test_cmp expected "$actual" +' + test_expect_success 'prompt - detached head' ' printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected && test_config core.abbrev 13 && |