Skip to content

Commit 045f575

Browse files
author
Junio C Hamano
committed
Merge 1.5.0.7 in
Signed-off-by: Junio C Hamano <[email protected]>
2 parents 0448352 + 9694ec4 commit 045f575

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

Documentation/RelNotes-1.5.0.7.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
GIT v1.5.0.7 Release Notes
2+
==========================
3+
4+
Fixes since v1.5.0.6
5+
--------------------
6+
7+
* Bugfixes
8+
9+
- git-upload-pack failed to close unused pipe ends, resulting
10+
in many zombies to hang around.
11+
12+
- git-rerere was recording the contents of earlier hunks
13+
duplicated in later hunks. This prevented resolving the same
14+
conflict when performing the same merge the other way around.
15+
16+
* Documentation
17+
18+
- a few documentation fixes from Debian package maintainer.

builtin-rerere.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ static void append_line(struct buffer *buffer, const char *line)
7878
buffer->nr += len;
7979
}
8080

81+
static void clear_buffer(struct buffer *buffer)
82+
{
83+
free(buffer->ptr);
84+
buffer->ptr = NULL;
85+
buffer->nr = buffer->alloc = 0;
86+
}
87+
8188
static int handle_file(const char *path,
8289
unsigned char *sha1, const char *output)
8390
{
@@ -131,6 +138,8 @@ static int handle_file(const char *path,
131138
SHA1_Update(&ctx, two->ptr, two->nr);
132139
SHA1_Update(&ctx, "\0", 1);
133140
}
141+
clear_buffer(one);
142+
clear_buffer(two);
134143
} else if (hunk == 1)
135144
append_line(one, buf);
136145
else if (hunk == 2)

t/t4200-rerere.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,35 @@ EOF
3434
git commit -q -a -m first
3535

3636
git checkout -b second master
37-
git show first:a1 | sed 's/To die, t/To die! T/' > a1
37+
git show first:a1 |
38+
sed -e 's/To die, t/To die! T/' -e 's/life;$/life./' > a1
3839
git commit -q -a -m second
3940

4041
# activate rerere
4142
mkdir .git/rr-cache
4243

4344
test_expect_failure 'conflicting merge' 'git pull . first'
4445

45-
sha1=4f58849a60b4f969a2848966b6d02893b783e8fb
46+
sha1=$(sed -e 's/\t.*//' .git/rr-cache/MERGE_RR)
4647
rr=.git/rr-cache/$sha1
4748
test_expect_success 'recorded preimage' "grep ======= $rr/preimage"
4849

4950
test_expect_success 'no postimage or thisimage yet' \
5051
"test ! -f $rr/postimage -a ! -f $rr/thisimage"
5152

53+
test_expect_success 'preimage have right number of lines' '
54+
55+
cnt=$(sed -ne "/^<<<<<<</,/^>>>>>>>/p" $rr/preimage | wc -l) &&
56+
test "$cnt" = 10
57+
58+
'
59+
5260
git show first:a1 > a1
5361

5462
cat > expect << EOF
5563
--- a/a1
5664
+++ b/a1
57-
@@ -6,11 +6,7 @@
65+
@@ -6,17 +6,9 @@
5866
The heart-ache and the thousand natural shocks
5967
That flesh is heir to, 'tis a consummation
6068
Devoutly to be wish'd.
@@ -66,8 +74,13 @@ cat > expect << EOF
6674
To sleep: perchance to dream: ay, there's the rub;
6775
For in that sleep of death what dreams may come
6876
When we have shuffled off this mortal coil,
77+
Must give us pause: there's the respect
78+
-<<<<<<<
79+
-That makes calamity of so long life.
80+
-=======
81+
That makes calamity of so long life;
82+
->>>>>>>
6983
EOF
70-
7184
git rerere diff > out
7285

7386
test_expect_success 'rerere diff' 'git diff expect out'

0 commit comments

Comments
 (0)