summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-12-19 01:38:18 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2006-12-19 01:38:18 -0800
commit5fed4668153c9ca6e44ec84a0976089f515705aa (patch)
tree82f3ce0d2ea76ca31cebd3a5b40d0993e019859a /t
parentgit-clone: lose the traditional 'no-separate-remote' layout (diff)
parentIntroduce GIT_TEMPLATE_DIR (diff)
downloadtgif-5fed4668153c9ca6e44ec84a0976089f515705aa.tar.xz
Merge branch 'jc/test-clone' into jc/clone
* jc/test-clone: (35 commits) Introduce GIT_TEMPLATE_DIR Revert "fix testsuite: make sure they use templates freshly built from the source" fix testsuite: make sure they use templates freshly built from the source rerere: fix breakage of resolving. Add config example with respect to branch Add documentation for show-branch --topics make git a bit less cryptic on fetch errors make patch_delta() error cases a bit more verbose racy-git: documentation updates. show-ref: fix --exclude-existing parse-remote::expand_refs_wildcard() vim syntax: follow recent changes to commit template show-ref: fix --verify --hash=length show-ref: fix --quiet --verify avoid accessing _all_ loose refs in git-show-ref --verify git-fetch: Avoid reading packed refs over and over again Teach show-branch how to show ref-log data. markup fix in svnimport documentation. Documentation: new option -P for git-svnimport Fix mis-mark-up in git-merge-file.txt documentation ...
Diffstat (limited to 't')
-rwxr-xr-xt/t0000-basic.sh9
-rwxr-xr-xt/t1300-repo-config.sh48
-rwxr-xr-xt/t3200-branch.sh6
-rwxr-xr-xt/test-lib.sh3
4 files changed, 65 insertions, 1 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 3260d1d7a7..0cd1c41866 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -272,4 +272,13 @@ test_expect_success \
wc -l) &&
test $numparent = 1'
+test_expect_success 'update-index D/F conflict' '
+ mv path0 tmp &&
+ mv path2 path0 &&
+ mv tmp path2 &&
+ git update-index --add --replace path2 path0/file2 &&
+ numpath0=$(git ls-files path0 | wc -l) &&
+ test $numpath0 = 1
+'
+
test_done
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 &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ac7be769b4..f0f9cd6be0 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -208,8 +208,9 @@ test_done () {
# t/ subdirectory and are run in trash subdirectory.
PATH=$(pwd)/..:$PATH
GIT_EXEC_PATH=$(pwd)/..
+GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
HOME=$(pwd)/trash
-export PATH GIT_EXEC_PATH HOME
+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR HOME
GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
export GITPERLLIB