diff options
author | Junio C Hamano <junkio@cox.net> | 2006-12-18 05:27:17 +0300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-18 05:27:17 +0300 |
commit | bdf17a02fd3224c5308c6451a6965476626f0578 (patch) | |
tree | fdb8c10d374076eb5612b67b8101a624f615e06c /t | |
parent | 9057695012daec51980eed19947a848f93f91503 (diff) | |
parent | dc81c58cd6b791a3db23f1d1acb5f7d38d1ff086 (diff) |
Merge branch 'js/branch-config'
* js/branch-config:
git-branch: rename config vars branch.<branch>.*, too
add a function to rename sections in the config
Diffstat (limited to 't')
-rwxr-xr-x | t/t1300-repo-config.sh | 48 | ||||
-rwxr-xr-x | t/t3200-branch.sh | 6 |
2 files changed, 54 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 16cd642610..e48a4ecdcf 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -343,5 +343,53 @@ EOF test_expect_success '--set in alternative GIT_CONFIG' 'cmp other-config expect' +cat > .git/config << EOF +# Hallo + #Bello +[branch "eins"] + x = 1 +[branch.eins] + y = 1 + [branch "1 234 blabl/a"] +weird +EOF + +test_expect_success "rename section" \ + "git-repo-config --rename-section branch.eins branch.zwei" + +cat > expect << EOF +# Hallo + #Bello +[branch "zwei"] + x = 1 +[branch "zwei"] + y = 1 + [branch "1 234 blabl/a"] +weird +EOF + +test_expect_success "rename succeeded" "diff -u expect .git/config" + +test_expect_failure "rename non-existing section" \ + 'git-repo-config --rename-section branch."world domination" branch.drei' + +test_expect_success "rename succeeded" "diff -u expect .git/config" + +test_expect_success "rename another section" \ + 'git-repo-config --rename-section branch."1 234 blabl/a" branch.drei' + +cat > expect << EOF +# Hallo + #Bello +[branch "zwei"] + x = 1 +[branch "zwei"] + y = 1 +[branch "drei"] +weird +EOF + +test_expect_success "rename succeeded" "diff -u expect .git/config" + test_done diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 5782c30b03..a6ea0f6a19 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -94,6 +94,8 @@ test_expect_failure \ git-branch r && git-branch -m q r/q' +git-repo-config branch.s/s.dummy Hello + test_expect_success \ 'git branch -m s/s s should work when s/t is deleted' \ 'git-branch -l s/s && @@ -104,6 +106,10 @@ test_expect_success \ git-branch -m s/s s && test -f .git/logs/refs/heads/s' +test_expect_success 'config information was renamed, too' \ + "test $(git-repo-config branch.s.dummy) = Hello && + ! git-repo-config branch.s/s/dummy" + test_expect_failure \ 'git-branch -m u v should fail when the reflog for u is a symlink' \ 'git-branch -l u && |