]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9903-bash-prompt.sh
git-prompt: show presence of unresolved conflicts at command prompt
[thirdparty/git.git] / t / t9903-bash-prompt.sh
index 6a30f5719c33260cb57fca2112d77bc1f9515375..d459fae6551bd7b5812f8b76a5faae8ebd4075df 100755 (executable)
@@ -759,4 +759,20 @@ test_expect_success 'prompt - hide if pwd ignored - inside gitdir' '
        test_cmp expected "$actual"
 '
 
+test_expect_success 'prompt - conflict indicator' '
+       printf " (main|CONFLICT)" >expected &&
+       echo "stash" >file &&
+       git stash &&
+       test_when_finished "git stash drop" &&
+       echo "commit" >file &&
+       git commit -m "commit" file &&
+       test_when_finished "git reset --hard HEAD~" &&
+       test_must_fail git stash apply &&
+       (
+               GIT_PS1_SHOWCONFLICTSTATE="yes" &&
+               __git_ps1 >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
 test_done