false directory/file merge conflict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a directory (with contents) has changed into a file on one
branch, and another branch attempts to merge it, there's a false
conflict - the directory is processed before its contents are removed.
This is particularly nasty, because "resolving" the non-existent
conflict results in no changes, so future merges will fail in exactly
the same way.  Test script and failed merge output below.

Jeffrey

-- 8< --

rm -rf directory-file
mkdir directory-file
cd directory-file
git init

mkdir foo
echo bar > foo/bar
echo bas > foo/baz
git add foo/bar foo/baz
git commit -m "check in files"

git branch foo_unchanged

git rm -r foo
echo foo > foo
git add foo
git commit -m "foo changes from directory to file"

git checkout foo_unchanged
echo foobar > foobar
git add foobar
git commit -m "make a separate change"

git merge master

-- 8< --

CONFLICT (directory/file): There is a directory with name foo in HEAD.
Adding foo as foo~master
Removing foo/bar
Removing foo/baz
Automatic merge failed; fix conflicts and then commit the result.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]