# fatal error when merging a rename

1 messages from 2009-04-20 to 2009-04-20. Participants: Anders Melchiorsen.
Thread: https://gitlist.dev/t/18970

## Anders Melchiorsen, 2009-04-20 15:36

Subject: fatal error when merging a rename
Message-ID: <57090.bFoQE3daRhY=.1240241789.squirrel@webmail.hotelhot.dk>
URL: https://gitlist.dev/e/57090.bFoQE3daRhY%3D.1240241789.squirrel%40webmail.hotelhot.dk

```
The talk of merge corner cases made me remember this issue:

http://thread.gmane.org/gmane.comp.version-control.git/100859/focus=100956


The merge in the script below fails with this message:

fatal: git write-tree failed to write a tree

which is fixed by the (unapplied) patch from Alex in the thread above, but
the worktree is still not updated even with that patch.


Cheers,
Anders.



#!/bin/bash

GIT=$(which git)

cd $(mktemp -d am-merge-fail.XXXXXXX)
$GIT init

mkdir before
yes | head -n100 >before/100
touch after
$GIT add before/100 after
$GIT commit -minitial

$GIT branch parallel

$GIT rm before/100 after
mkdir after
yes | head -n99 >after/99
$GIT add after/99
$GIT commit -mmove

$GIT checkout parallel
echo "Just to cause a non-ff" >other
$GIT add other
$GIT commit -mparallel

$GIT merge master

```
