Merge branch 'wk/user-manual-literal-format'
[gitweb.git] / t / t9903-bash-prompt.sh
index dd9ac6a821a5bcd69447a4a65580eae261bb2fdb..2101d914f2d34d28b05ce17982a24c0b008809af 100755 (executable)
@@ -360,11 +360,47 @@ test_expect_success 'prompt - dirty status indicator - before root commit' '
        test_cmp expected "$actual"
 '
 
-test_expect_success 'prompt - dirty status indicator - disabled by config' '
+test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' '
        printf " (master)" > expected &&
        echo "dirty" > file &&
        test_when_finished "git reset --hard" &&
        test_config bash.showDirtyState false &&
+       (
+               sane_unset GIT_PS1_SHOWDIRTYSTATE &&
+               __git_ps1 > "$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' '
+       printf " (master)" > expected &&
+       echo "dirty" > file &&
+       test_when_finished "git reset --hard" &&
+       test_config bash.showDirtyState true &&
+       (
+               sane_unset GIT_PS1_SHOWDIRTYSTATE &&
+               __git_ps1 > "$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' '
+       printf " (master)" > expected &&
+       echo "dirty" > file &&
+       test_when_finished "git reset --hard" &&
+       test_config bash.showDirtyState false &&
+       (
+               GIT_PS1_SHOWDIRTYSTATE=y &&
+               __git_ps1 > "$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' '
+       printf " (master *)" > expected &&
+       echo "dirty" > file &&
+       test_when_finished "git reset --hard" &&
+       test_config bash.showDirtyState true &&
        (
                GIT_PS1_SHOWDIRTYSTATE=y &&
                __git_ps1 > "$actual"