Merge branch 'jk/color-and-pager'

* jk/color-and-pager:
  want_color: automatically fallback to color.ui
  diff: don't load color config in plumbing
  config: refactor get_colorbool function
  color: delay auto-color decision until point of use
  git_config_colorbool: refactor stdout_is_tty handling
  diff: refactor COLOR_DIFF from a flag into an int
  setup_pager: set GIT_PAGER_IN_USE
  t7006: use test_config helpers
  test-lib: add helper functions for config
  t7006: modernize calls to unset

Conflicts:
	builtin/commit.c
	parse-options.c
This commit is contained in:
Junio C Hamano
2011-08-28 21:19:16 -07:00
21 changed files with 176 additions and 147 deletions

View File

@ -361,6 +361,24 @@ test_chmod () {
git update-index --add "--chmod=$@"
}
# Unset a configuration variable, but don't fail if it doesn't exist.
test_unconfig () {
git config --unset-all "$@"
config_status=$?
case "$config_status" in
5) # ok, nothing to unset
config_status=0
;;
esac
return $config_status
}
# Set git config, automatically unsetting it after the test is over.
test_config () {
test_when_finished "test_unconfig '$1'" &&
git config "$@"
}
# Use test_set_prereq to tell that a particular prerequisite is available.
# The prerequisite can later be checked for in two ways:
#