From 2fa9a0fb31cbf01e8318a02c3e222d7fd3fd0a83 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 2 May 2006 14:22:48 +0200 Subject: repo-config: support --get-regexp With --get-regexp, output all key/value pairs where the key matches a regexp. Example: git-repo-config --get-regexp remote.*.url will output something like remote.junio.url git://git.kernel.org/pub/scm/git/git.git remote.gitk.url git://git.kernel.org/pub/scm/gitk/gitk.git Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index ab4dd5c4ce..1bf728fb06 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -247,6 +247,24 @@ EOF test_expect_success 'hierarchical section value' 'cmp .git/config expect' +cat > expect << EOF +beta.noindent=sillyValue +nextsection.nonewline=wow2 for me +123456.a123=987 +1.2.3.alpha=beta +EOF + +test_expect_success 'working --list' \ + 'git-repo-config --list > output && cmp output expect' + +cat > expect << EOF +beta.noindent sillyValue +nextsection.nonewline wow2 for me +EOF + +test_expect_success '--get-regexp' \ + 'git-repo-config --get-regexp in > output && cmp output expect' + cat > .git/config << EOF [novalue] variable @@ -255,5 +273,10 @@ EOF test_expect_success 'get variable with no value' \ 'git-repo-config --get novalue.variable ^$' +git-repo-config > output 2>&1 + +test_expect_success 'no arguments, but no crash' \ + "test $? = 129 && grep usage output" + test_done -- cgit v1.2.3 From 83e77a25dc194933c0fb7908ab6d9fb84a5045e2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 May 2006 17:40:47 -0700 Subject: update-index --again After running 'git-update-index' for some paths, you may want to do the update on the same set of paths again. The new flag --again checks the paths whose index entries are are different from the HEAD commit and updates them from the working tree contents. This was brought up by Carl Worth on #git. Signed-off-by: Junio C Hamano --- t/t2101-update-index-reupdate.sh | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 t/t2101-update-index-reupdate.sh (limited to 't') diff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh new file mode 100755 index 0000000000..5c505c6ac8 --- /dev/null +++ b/t/t2101-update-index-reupdate.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Copyright (c) 2006 Junio C Hamano +# + +test_description='git-update-index --again test. +' + +. ./test-lib.sh + +test_expect_success 'update-index --add' \ + 'echo hello world >file1 && + echo goodbye people >file2 && + git-update-index --add file1 file2 && + git-ls-files -s >current && + cmp current - <<\EOF +100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1 +100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2 +EOF' + +test_expect_success 'update-index --again' \ + 'rm -f file1 && + echo hello everybody >file2 && + if git-update-index --again + then + echo should have refused to remove file1 + exit 1 + else + echo happy - failed as expected + fi && + git-ls-files -s >current && + cmp current - <<\EOF +100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1 +100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2 +EOF' + +test_expect_success 'update-index --remove --again' \ + 'git-update-index --remove --again && + git-ls-files -s >current && + cmp current - <<\EOF +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2 +EOF' + +test_expect_success 'first commit' 'git-commit -m initial' + +test_expect_success 'update-index again' \ + 'mkdir -p dir1 && + echo hello world >dir1/file3 && + echo goodbye people >file2 && + git-update-index --add file2 dir1/file3 && + echo hello everybody >file2 + echo happy >dir1/file3 && + git-update-index --again && + git-ls-files -s >current && + cmp current - <<\EOF +100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0 dir1/file3 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2 +EOF' + +test_expect_success 'update-index --update from subdir' \ + 'echo not so happy >file2 && + cd dir1 && + cat ../file2 >file3 && + git-update-index --again && + cd .. && + git-ls-files -s >current && + cmp current - <<\EOF +100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0 dir1/file3 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2 +EOF' + +test_done + -- cgit v1.2.3 From 22293b9c41778bb60f3b07355e1b8e421a503702 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 May 2006 23:09:05 -0700 Subject: update-index --again: take optional pathspecs When pathspecs are given, update-index --again further limits the set of paths to be updated to those that match them. Signed-off-by: Junio C Hamano --- t/t2101-update-index-reupdate.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh index 5c505c6ac8..77aed8d800 100755 --- a/t/t2101-update-index-reupdate.sh +++ b/t/t2101-update-index-reupdate.sh @@ -69,5 +69,14 @@ test_expect_success 'update-index --update from subdir' \ 100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2 EOF' -test_done +test_expect_success 'update-index --update with pathspec' \ + 'echo very happy >file2 && + cat file2 >dir1/file3 && + git-update-index --again dir1/ && + git-ls-files -s >current && + cmp current - <<\EOF +100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0 dir1/file3 +100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2 +EOF' +test_done -- cgit v1.2.3 From 42d0ee8302c361a0e3bde7bc59858eda94bc13a4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 6 May 2006 00:15:54 -0700 Subject: binary diff and apply: testsuite. Signed-off-by: Junio C Hamano --- t/t4012-diff-binary.sh | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ t/test4012.png | Bin 0 -> 5660 bytes 2 files changed, 85 insertions(+) create mode 100755 t/t4012-diff-binary.sh create mode 100644 t/test4012.png (limited to 't') diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh new file mode 100755 index 0000000000..bdd95c0d3d --- /dev/null +++ b/t/t4012-diff-binary.sh @@ -0,0 +1,85 @@ +#!/bin/sh +# +# Copyright (c) 2006 Junio C Hamano +# + +test_description='Binary diff and apply +' + +. ./test-lib.sh + +test_expect_success 'prepare repository' \ + 'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d && + git-update-index --add a b c d && + echo git >a && + cat ../test4012.png >b && + echo git >c && + cat b b >d' + +test_expect_success 'diff without --binary' \ + 'git-diff | git-apply --stat --summary >current && + cmp current - <<\EOF + a | 2 +- + b | Bin + c | 2 +- + d | Bin + 4 files changed, 2 insertions(+), 2 deletions(-) +EOF' + +test_expect_success 'diff with --binary' \ + 'git-diff --binary | git-apply --stat --summary >current && + cmp current - <<\EOF + a | 2 +- + b | Bin + c | 2 +- + d | Bin + 4 files changed, 2 insertions(+), 2 deletions(-) +EOF' + +# apply needs to be able to skip the binary material correctly +# in order to report the line number of a corrupt patch. +test_expect_success 'apply detecting corrupt patch correctly' \ + 'git-diff | sed -e 's/-CIT/xCIT/' >broken && + if git-apply --stat --summary broken 2>detected + then + echo unhappy - should have detected an error + (exit 1) + else + echo happy + fi && + detected=`cat detected` && + detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` && + detected=`sed -ne "${detected}p" broken` && + test "$detected" = xCIT' + +test_expect_success 'apply detecting corrupt patch correctly' \ + 'git-diff --binary | sed -e 's/-CIT/xCIT/' >broken && + if git-apply --stat --summary broken 2>detected + then + echo unhappy - should have detected an error + (exit 1) + else + echo happy + fi && + detected=`cat detected` && + detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` && + detected=`sed -ne "${detected}p" broken` && + test "$detected" = xCIT' + +test_expect_success 'initial commit' 'git-commit -a -m initial' + +# Try removal (b), modification (d), and creation (e). +test_expect_success 'diff-index with --binary' \ + 'echo AIT >a && mv b e && echo CIT >c && cat e >d && + git-update-index --add --remove a b c d e && + tree0=`git-write-tree` && + git-diff --cached --binary >current && + git-apply --stat --summary current' + +test_expect_success 'apply binary patch' \ + 'git-reset --hard && + git-apply --binary --index Date: Sat, 6 May 2006 15:43:43 -0400 Subject: t1300-repo-config: two new config parsing tests. - correctly insert a new variable into a section that only contains a single (different) variable. - correctly insert a new section that matches the initial substring of an existing section. Signed-off-by: Sean Estabrooks Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 1bf728fb06..7090ea92c1 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -278,5 +278,36 @@ git-repo-config > output 2>&1 test_expect_success 'no arguments, but no crash' \ "test $? = 129 && grep usage output" +cat > .git/config << EOF +[a.b] + c = d +EOF + +git-repo-config a.x y + +cat > expect << EOF +[a.b] + c = d +[a] + x = y +EOF + +test_expect_success 'new section is partial match of another' 'cmp .git/config expect' + +git-repo-config b.x y +git-repo-config a.b c + +cat > expect << EOF +[a.b] + c = d +[a] + x = y + b = c +[b] + x = y +EOF + +test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect' + test_done -- cgit v1.2.3 From cf9dc65368113caa28f2829e2ada5477fbb031ec Mon Sep 17 00:00:00 2001 From: Martin Waitz Date: Sun, 7 May 2006 20:19:09 +0200 Subject: clone: keep --reference even with -l -s Both -l -s and --reference update objects/info/alternates and used to write over each other. Signed-off-by: Martin Waitz Signed-off-by: Junio C Hamano --- t/t5700-clone-reference.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100755 t/t5700-clone-reference.sh (limited to 't') diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh new file mode 100755 index 0000000000..916ee15ba1 --- /dev/null +++ b/t/t5700-clone-reference.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Copyright (C) 2006 Martin Waitz +# + +test_description='test clone --reference' +. ./test-lib.sh + +base_dir=`pwd` + +test_expect_success 'preparing first repository' \ +'test_create_repo A && cd A && +echo first > file1 && +git add file1 && +git commit -m initial' + +cd "$base_dir" + +test_expect_success 'preparing second repository' \ +'git clone A B && cd B && +echo second > file2 && +git add file2 && +git commit -m addition && +git repack -a -d && +git prune' + +cd "$base_dir" + +test_expect_success 'cloning with reference' \ +'git clone -l -s --reference B A C' + +cd "$base_dir" + +test_expect_success 'existance of info/alternates' \ +'test `wc -l expected && +git count-objects > current && +diff expected current' + +cd "$base_dir" + +test_expect_success 'updating origin' \ +'cd A && +echo third > file3 && +git add file3 && +git commit -m update && +git repack -a -d && +git prune' + +cd "$base_dir" + +test_expect_success 'pulling changes from origin' \ +'cd C && +git pull origin' + +cd "$base_dir" + +# the 2 local objects are commit and tree from the merge +test_expect_success 'that alternate to origin gets used' \ +'cd C && +echo "2 objects" > expected && +git count-objects | cut -d, -f1 > current && +diff expected current' + +cd "$base_dir" + +test_done -- cgit v1.2.3 From dd05ea1799656024a45017238bbd4857b5256370 Mon Sep 17 00:00:00 2001 From: Martin Waitz Date: Sun, 7 May 2006 20:19:47 +0200 Subject: test case for transitive info/alternates Signed-off-by: Martin Waitz Signed-off-by: Junio C Hamano --- t/t5710-info-alternate.sh | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 t/t5710-info-alternate.sh (limited to 't') diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh new file mode 100755 index 0000000000..097d037f5d --- /dev/null +++ b/t/t5710-info-alternate.sh @@ -0,0 +1,105 @@ +#!/bin/sh +# +# Copyright (C) 2006 Martin Waitz +# + +test_description='test transitive info/alternate entries' +. ./test-lib.sh + +# test that a file is not reachable in the current repository +# but that it is after creating a info/alternate entry +reachable_via() { + alternate="$1" + file="$2" + if git cat-file -e "HEAD:$file"; then return 1; fi + echo "$alternate" >> .git/objects/info/alternate + git cat-file -e "HEAD:$file" +} + +test_valid_repo() { + git fsck-objects --full > fsck.log && + test `wc -l < fsck.log` = 0 +} + +base_dir=`pwd` + +test_expect_success 'preparing first repository' \ +'test_create_repo A && cd A && +echo "Hello World" > file1 && +git add file1 && +git commit -m "Initial commit" file1 && +git repack -a -d && +git prune' + +cd "$base_dir" + +test_expect_success 'preparing second repository' \ +'git clone -l -s A B && cd B && +echo "foo bar" > file2 && +git add file2 && +git commit -m "next commit" file2 && +git repack -a -d -l && +git prune' + +cd "$base_dir" + +test_expect_success 'preparing third repository' \ +'git clone -l -s B C && cd C && +echo "Goodbye, cruel world" > file3 && +git add file3 && +git commit -m "one more" file3 && +git repack -a -d -l && +git prune' + +cd "$base_dir" + +test_expect_failure 'creating too deep nesting' \ +'git clone -l -s C D && +git clone -l -s D E && +git clone -l -s E F && +git clone -l -s F G && +test_valid_repo' + +cd "$base_dir" + +test_expect_success 'validity of third repository' \ +'cd C && +test_valid_repo' + +cd "$base_dir" + +test_expect_success 'validity of fourth repository' \ +'cd D && +test_valid_repo' + +cd "$base_dir" + +test_expect_success 'breaking of loops' \ +"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&& +cd C && +test_valid_repo" + +cd "$base_dir" + +test_expect_failure 'that info/alternates is neccessary' \ +'cd C && +rm .git/objects/info/alternates && +test_valid_repo' + +cd "$base_dir" + +test_expect_success 'that relative alternate is possible for current dir' \ +'cd C && +echo "../../../B/.git/objects" > .git/objects/info/alternates && +test_valid_repo' + +cd "$base_dir" + +test_expect_failure 'that relative alternate is only possible for current dir' \ +'cd D && +test_valid_repo' + +cd "$base_dir" + +test_done + -- cgit v1.2.3 From d14f776402d9f7040cc71ff6e3b992b2e019526a Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 9 May 2006 12:24:02 -0700 Subject: git config syntax updates This updates the hierarchical section name syntax to [section+""] where the only rule for "randomstring" is that it can't contain a newline, and if you really want to insert a double-quote, you do it with \". It turns that into the section name "secion.randomstring". The "section" part is still case insensitive, but the "randomstring" part is case sensitive. So you could use this for things like [email "torvalds@osdl.org"] name = Linus Torvalds if you wanted to do the "email->name" conversion as part of the config file format (I'm not claiming that is sensible, I'm just giving it as an insane example). That would show up as the association email.torvalds@osdl.org.name -> Linus Torvalds which is easy to parse (the "." in the email _looks_ ambiguous, but it isn't: you know that there will always be a single key-name, so you find the key name with "strrchr(name, '.')" and things are entirely unambiguous). Repo-config is updated to be able to parse the new format, and also write things out in the new format. [jc: rolled two patches from Linus and one fix-up from Sean into one, with additional adjustments for t/t1300 test to check the case insensitiveness of section base and variable and case sensitiveness of the extended section part. Then stripped some part off to make the result applicable to the stale 1.3.X series that does not have recent enhancements. ] Signed-off-by: Linus Torvalds Signed-off-by: Sean Estabrooks Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index ab4dd5c4ce..028d15956b 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -229,7 +229,7 @@ test_expect_failure 'invalid key' 'git-repo-config inval.2key blabla' test_expect_success 'correct key' 'git-repo-config 123456.a123 987' test_expect_success 'hierarchical section' \ - 'git-repo-config 1.2.3.alpha beta' + 'git-repo-config Version.1.2.3eX.Alpha beta' cat > expect << EOF [beta] ; silly comment # another comment @@ -241,8 +241,8 @@ noIndent= sillyValue ; 'nother silly comment NoNewLine = wow2 for me [123456] a123 = 987 -[1.2.3] - alpha = beta +[Version "1.2.3eX"] + Alpha = beta EOF test_expect_success 'hierarchical section value' 'cmp .git/config expect' -- cgit v1.2.3 From fcc387db9bc453dc7e07a262873481af2ee9e5c8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 17 May 2006 01:17:46 -0700 Subject: read-tree -m -u: do not overwrite or remove untracked working tree files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a merge results in a creation of a path that did not exist in HEAD, and if you already have that path on the working tree, because the index has not been told about the working tree file, read-tree happily removes it. The issue was brought up by Santi BĂ©jar on the list. Signed-off-by: Junio C Hamano --- t/t1002-read-tree-m-u-2way.sh | 66 ++++++++++++++++++++++++++++--------------- t/t3500-cherry.sh | 1 + t/t4002-diff-basic.sh | 6 ++-- t/t6022-merge-rename.sh | 1 + 4 files changed, 48 insertions(+), 26 deletions(-) (limited to 't') diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh index 4d175d8ea1..8335a63e2e 100755 --- a/t/t1002-read-tree-m-u-2way.sh +++ b/t/t1002-read-tree-m-u-2way.sh @@ -39,7 +39,6 @@ test_expect_success \ echo nitfol >nitfol && echo bozbar >bozbar && echo rezrov >rezrov && - echo yomin >yomin && git-update-index --add nitfol bozbar rezrov && treeH=`git-write-tree` && echo treeH $treeH && @@ -56,7 +55,8 @@ test_expect_success \ test_expect_success \ '1, 2, 3 - no carry forward' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && git-read-tree -m -u $treeH $treeM && git-ls-files --stage >1-3.out && cmp M.out 1-3.out && @@ -66,11 +66,12 @@ test_expect_success \ check_cache_at frotz clean && check_cache_at nitfol clean' -echo '+100644 X 0 yomin' >expected - test_expect_success \ '4 - carry forward local addition.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && + echo "+100644 X 0 yomin" >expected && + echo yomin >yomin && git-update-index --add yomin && git-read-tree -m -u $treeH $treeM && git-ls-files --stage >4.out || return 1 @@ -85,7 +86,9 @@ test_expect_success \ test_expect_success \ '5 - carry forward local addition.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && + git-read-tree -m -u $treeH && echo yomin >yomin && git-update-index --add yomin && echo yomin yomin >yomin && @@ -103,7 +106,9 @@ test_expect_success \ test_expect_success \ '6 - local addition already has the same.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && + echo frotz >frotz && git-update-index --add frotz && git-read-tree -m -u $treeH $treeM && git-ls-files --stage >6.out && @@ -117,7 +122,8 @@ test_expect_success \ test_expect_success \ '7 - local addition already has the same.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo frotz >frotz && git-update-index --add frotz && echo frotz frotz >frotz && @@ -134,14 +140,16 @@ test_expect_success \ test_expect_success \ '8 - conflicting addition.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo frotz frotz >frotz && git-update-index --add frotz && if git-read-tree -m -u $treeH $treeM; then false; else :; fi' test_expect_success \ '9 - conflicting addition.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo frotz frotz >frotz && git-update-index --add frotz && echo frotz >frotz && @@ -149,7 +157,8 @@ test_expect_success \ test_expect_success \ '10 - path removed.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo rezrov >rezrov && git-update-index --add rezrov && git-read-tree -m -u $treeH $treeM && @@ -160,7 +169,8 @@ test_expect_success \ test_expect_success \ '11 - dirty path removed.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo rezrov >rezrov && git-update-index --add rezrov && echo rezrov rezrov >rezrov && @@ -168,14 +178,16 @@ test_expect_success \ test_expect_success \ '12 - unmatching local changes being removed.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo rezrov rezrov >rezrov && git-update-index --add rezrov && if git-read-tree -m -u $treeH $treeM; then false; else :; fi' test_expect_success \ '13 - unmatching local changes being removed.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo rezrov rezrov >rezrov && git-update-index --add rezrov && echo rezrov >rezrov && @@ -188,7 +200,8 @@ EOF test_expect_success \ '14 - unchanged in two heads.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo nitfol nitfol >nitfol && git-update-index --add nitfol && git-read-tree -m -u $treeH $treeM && @@ -207,7 +220,8 @@ test_expect_success \ test_expect_success \ '15 - unchanged in two heads.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo nitfol nitfol >nitfol && git-update-index --add nitfol && echo nitfol nitfol nitfol >nitfol && @@ -227,14 +241,16 @@ test_expect_success \ test_expect_success \ '16 - conflicting local change.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo bozbar bozbar >bozbar && git-update-index --add bozbar && if git-read-tree -m -u $treeH $treeM; then false; else :; fi' test_expect_success \ '17 - conflicting local change.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo bozbar bozbar >bozbar && git-update-index --add bozbar && echo bozbar bozbar bozbar >bozbar && @@ -242,7 +258,8 @@ test_expect_success \ test_expect_success \ '18 - local change already having a good result.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo gnusto >bozbar && git-update-index --add bozbar && git-read-tree -m -u $treeH $treeM && @@ -254,7 +271,8 @@ test_expect_success \ test_expect_success \ '19 - local change already having a good result, further modified.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo gnusto >bozbar && git-update-index --add bozbar && echo gnusto gnusto >bozbar && @@ -273,7 +291,8 @@ test_expect_success \ test_expect_success \ '20 - no local change, use new tree.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo bozbar >bozbar && git-update-index --add bozbar && git-read-tree -m -u $treeH $treeM && @@ -285,7 +304,8 @@ test_expect_success \ test_expect_success \ '21 - no local change, dirty cache.' \ - 'rm -f .git/index && + 'rm -f .git/index nitfol bozbar rezrov frotz && + git-read-tree --reset -u $treeH && echo bozbar >bozbar && git-update-index --add bozbar && echo gnusto gnusto >bozbar && @@ -294,7 +314,7 @@ test_expect_success \ # Also make sure we did not break DF vs DF/DF case. test_expect_success \ 'DF vs DF/DF case setup.' \ - 'rm -f .git/index && + 'rm -f .git/index echo DF >DF && git-update-index --add DF && treeDF=`git-write-tree` && diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh index b141f89de2..e83bbee074 100755 --- a/t/t3500-cherry.sh +++ b/t/t3500-cherry.sh @@ -30,6 +30,7 @@ test_expect_success \ git-commit -m "Add C." && git-checkout -f master && + rm -f B C && echo Third >> A && git-update-index A && diff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh index 769274aa51..56eda63fc2 100755 --- a/t/t4002-diff-basic.sh +++ b/t/t4002-diff-basic.sh @@ -191,7 +191,7 @@ test_expect_success \ 'rm -fr Z [A-Z][A-Z] && git-read-tree $tree_A && git-checkout-index -f -a && - git-read-tree -m $tree_O || return 1 + git-read-tree --reset $tree_O || return 1 git-update-index --refresh >/dev/null ;# this can exit non-zero git-diff-files >.test-a && cmp_diff_files_output .test-a .test-recursive-OA' @@ -201,7 +201,7 @@ test_expect_success \ 'rm -fr Z [A-Z][A-Z] && git-read-tree $tree_B && git-checkout-index -f -a && - git-read-tree -m $tree_O || return 1 + git-read-tree --reset $tree_O || return 1 git-update-index --refresh >/dev/null ;# this can exit non-zero git-diff-files >.test-a && cmp_diff_files_output .test-a .test-recursive-OB' @@ -211,7 +211,7 @@ test_expect_success \ 'rm -fr Z [A-Z][A-Z] && git-read-tree $tree_B && git-checkout-index -f -a && - git-read-tree -m $tree_A || return 1 + git-read-tree --reset $tree_A || return 1 git-update-index --refresh >/dev/null ;# this can exit non-zero git-diff-files >.test-a && cmp_diff_files_output .test-a .test-recursive-AB' diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh index a2d24b5ca9..5ac25647ab 100755 --- a/t/t6022-merge-rename.sh +++ b/t/t6022-merge-rename.sh @@ -111,6 +111,7 @@ test_expect_success 'pull renaming branch into unrenaming one' \ test_expect_success 'pull renaming branch into another renaming one' \ ' + rm -f B git reset --hard git checkout red git pull . white && { -- cgit v1.2.3