My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 927 attachment: test-case.sh (1007 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# test-case for jgit merge where two developers touch the same file
# one developer does rename and another update
# when you merge the branches weird things happen
#
# (you must have jgit and git on your $PATH for this to work)
#

set -x

# output will to to test-case
mkdir "test-case"

# create initial repo sitory with file 'x'
mkdir orig
cd orig
git init
echo "add x" > x
git add x
git commit -m "add x"
cd ..

# create bare
git clone --bare orig bare

# prepare repositories where development will diverge
git clone bare d1
git clone bare d2

# do rename
cd d1
git mv x y
git commit -m "d1 rename x -> y"
cd ..

# do change
cd d2
echo "d2 change" >> x
git add x
git commit -m "d2 change in x"
cd ..

# try to merge that with jgit
git clone bare merge-jgit
cd merge-jgit
git remote add d1 ../d1
git remote add d2 ../d2
git remote update

# this will be fast-forward (as expected)
jgit merge d1/master

# this used to mismerge tree, now it is null pointer exception
jgit merge d2/master

Powered by Google Project Hosting