diff options
author | Pranit Bauva <pranit.bauva@gmail.com> | 2016-05-05 15:20:02 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-10 10:25:52 -0700 |
commit | aaab84203b9654fb73df41d3cb71a6aad3a091fa (patch) | |
tree | 1c3a054dd95694de923756d99fee1c068d15d498 /t | |
parent | de45dbb8188ecbc74c1e8a95bf861c6acdda393d (diff) | |
download | git-aaab84203b9654fb73df41d3cb71a6aad3a091fa.tar.gz git-aaab84203b9654fb73df41d3cb71a6aad3a091fa.tar.xz |
commit: add a commit.verbose config variable
Add commit.verbose configuration variable as a convenience for those
who always prefer --verbose.
Add tests to check the behavior introduced by this commit and also to
verify that behavior of status doesn't break because of this commit.
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7507-commit-verbose.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh index 5a811812f..ed2653d46 100755 --- a/t/t7507-commit-verbose.sh +++ b/t/t7507-commit-verbose.sh @@ -103,4 +103,55 @@ test_expect_success 'status does not verbose without --verbose' ' ! grep "^diff --git" actual ' +test_expect_success 'setup -v -v' ' + echo dirty >file +' + +for i in true 1 +do + test_expect_success "commit.verbose=$i and --verbose omitted" " + git -c commit.verbose=$i commit --amend && + test_line_count = 1 out + " +done + +for i in false -2 -1 0 +do + test_expect_success "commit.verbose=$i and --verbose omitted" " + git -c commit.verbose=$i commit --amend && + test_line_count = 0 out + " +done + +for i in 2 3 +do + test_expect_success "commit.verbose=$i and --verbose omitted" " + git -c commit.verbose=$i commit --amend && + test_line_count = 2 out + " +done + +for i in true false -2 -1 0 1 2 3 +do + test_expect_success "commit.verbose=$i and --verbose" " + git -c commit.verbose=$i commit --amend --verbose && + test_line_count = 1 out + " + + test_expect_success "commit.verbose=$i and --no-verbose" " + git -c commit.verbose=$i commit --amend --no-verbose && + test_line_count = 0 out + " + + test_expect_success "commit.verbose=$i and -v -v" " + git -c commit.verbose=$i commit --amend -v -v && + test_line_count = 2 out + " +done + +test_expect_success "status ignores commit.verbose=true" ' + git -c commit.verbose=true status >actual && + ! grep "^diff --git actual" +' + test_done |