summaryrefslogtreecommitdiff
path: root/doc/bugs/Merge_involving_symlink_yields_unexpected_results.mdwn
blob: 942db3dd22e8e75775b326ede329c0a37734c6e0 (plain)
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
### Please describe the problem.
When creating a symlink in repository A, and creating a regular file under the same name in repository B, syncing B will yield the result that the symlink is lost, and both the original filename and the .variant file will point to the same annex object containing the original content from B.

Both A and B are indirect mode repos.

### What steps will reproduce the problem?

[[!format  sh """

#Initial state:

repo-A$ echo file1
This is file 1.
repo-B$ echo file1
This is file 1.

#Make conflicting changes:

repo-A$ ln -s file1 file2; git add file2; git commit -m "Add file2 as symlink."
repo-B$ echo "This is file 2." > file2; git annex add file2; git commit -m "Add file2 as regular file."

#Sync it:

repo-A$ git annex sync
repo-B$ git annex sync

#Strange result in repo-B:

repo-B$ ls -l file2*
file2 -> .git/annex/objects/$HASH1
file2.variant1234 -> .git/annex/objects/$HASH1
repo-B$ cat file2 file2.variantXXXX
This is file 2.
This is file 2.

#Repo-A leaves the symlink change untouched and adds a .variant containing the new regular file data.

repo-A$ ls -l file*
file2 -> file1
file2.variant1234 -> .git/annex/objects/$HASH1
repo-A$ cat file.variant1234
This is file 2.
"""]]
### What version of git-annex are you using? On what operating system?
Linux 3.15.3
git-annex  5.20140613