* [PATCH] Add a test case for rerere
@ 2006-04-28 7:56 Uwe Zeisberger
2006-04-28 8:02 ` Uwe Zeisberger
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Zeisberger @ 2006-04-28 7:56 UTC (permalink / raw)
To: git
Currently this test fails because rerere is not able to record
resolves for a file that don't exist in the merge base but in
both branches to merge.
Signed-off-by: Uwe Zeisberger <Uwe_Zeisberger@digi.com>
---
t/t8003-rerere.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 66 insertions(+), 0 deletions(-)
create mode 100644 t/t8003-rerere.sh
It's the last command that fails because rerere didn't record the
conflict between branch1:file-common and master:file-common.
Please feel free to change the filename as I don't know/see the naming
scheme of the tests.
Best regards
Uwe
ff012a80cafa3fe905de72d0db8b616ff76d0038
diff --git a/t/t8003-rerere.sh b/t/t8003-rerere.sh
new file mode 100644
index 0000000..1bb66ff
--- /dev/null
+++ b/t/t8003-rerere.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+test_description='git-rerere'
+. ./test-lib.sh
+
+
+test_expect_success 'prepare repository' \
+'mkdir .git/rr-cache &&
+echo "content" > file-base &&
+git add file-base &&
+git commit -m "Initial commit" &&
+git branch branch &&
+echo "added after branch" >> file-base &&
+echo "added after branch" >> file-common &&
+git add file-common &&
+git commit -m "master1" -i file-base file-common &&
+git checkout branch &&
+echo "added in branch" >> file-base &&
+echo "only in branch" > file-branch &&
+echo "added in branch" >> file-common &&
+git add file-branch file-common &&
+git commit -m "branch1" -i file-base file-branch file-common &&
+git branch branch1'
+
+test_expect_failure 'pull master' \
+'git pull . master'
+
+cat >> file-base-expect << EOF
+content
+<<<<<<< HEAD/file-base
+added in branch
+=======
+added after branch
+>>>>>>> `git rev-parse master`/file-base
+EOF
+
+test_expect_success 'merge result' \
+'cmp file-base file-base-expect &&
+git cat-file blob HEAD:file-common | cmp file-common~HEAD - &&
+git cat-file blob master:file-common | cmp file-common~`git rev-parse master` - &&
+git cat-file blob HEAD:file-branch | cmp file-branch -'
+
+test_expect_success 'record and resolve confilcts' \
+'git rerere &&
+echo "content
+added in branch
+added after branch" > file-base &&
+echo "added in branch
+added after branch" > file-common &&
+git rerere &&
+git-ls-files -o | xargs rm &&
+git commit -m "resolved conflicts" -i file-base file-common file-branch &&
+git-checkout master
+'
+
+test_expect_failure 'pull branch1' \
+'git pull . branch1'
+
+test_expect_success 'reuse recorded resolve' \
+'git rerere &&
+git cat-file blob branch:file-branch | cmp file-branch - &&
+git cat-file blob branch:file-base | cmp file-base - &&
+git cat-file blob branch:file-common | cmp file-common -'
+
+test_done
+
--
1.3.1.gac92
--
Uwe Zeisberger
FS Forth-Systeme GmbH, A Digi International Company
Kueferstrasse 8, D-79206 Breisach, Germany
Phone: +49 (7667) 908 0 Fax: +49 (7667) 908 200
Web: www.fsforth.de, www.digi.com
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Add a test case for rerere
2006-04-28 7:56 [PATCH] Add a test case for rerere Uwe Zeisberger
@ 2006-04-28 8:02 ` Uwe Zeisberger
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Zeisberger @ 2006-04-28 8:02 UTC (permalink / raw)
To: git
Hello,
Uwe Zeisberger wrote:
> +echo "added in branch" >> file-common &&
> +git add file-branch file-common &&
> +git commit -m "branch1" -i file-base file-branch file-common &&
> +git branch branch1'
> +
> ...
> +
> +test_expect_failure 'pull branch1' \
> +'git pull . branch1'
When typing the test I first tried to pull branch^, but this failed with
"no such remote ref refs/heads/branch^". Is it intended that one can
only pull branches and not any rev?
Best regards
Uwe
PS: I added a double blank line in the file. Sorry for that...
--
Uwe Zeisberger
http://www.google.com/search?q=Planck%27s+constant%3D
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-28 8:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 7:56 [PATCH] Add a test case for rerere Uwe Zeisberger
2006-04-28 8:02 ` Uwe Zeisberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).