This adds a simple test if a section is properly removed, even if the section header is repeated in the config. Not-yet-Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx> Waits-for-ack-by: Paolo Bonzini <bonzini@xxxxxxx> --- On Thu, 1 Mar 2007, Alex Riesen wrote: > On 3/1/07, Paolo Bonzini <bonzini@xxxxxxx> wrote: > > As per the subject. The existing --rename-section option is > > undocumented, while --remove-section is added by this patch > > based on the code I had written for the "git branch" patch. > > You desperately need tests for this code. Something like this? Totally untested (of course)... t/t1300-repo-config.sh | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 3753e9f..6b15a3e 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -391,6 +391,22 @@ EOF test_expect_success "rename succeeded" "diff -u expect .git/config" +test_expect_success "remove section" "git config --remove-section branch.zwei" + +cat > expect << EOF +# Hallo + #Bello +[branch "zwei"] + x = 1 +[branch "zwei"] + y = 1 +[branch "drei"] +weird +EOF + +test_expect_success "section was removed properly" \ + "diff -u expect .git/config" + test_expect_success numbers ' git-config kilo.gram 1k && - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html