{"thread":{"id":"18970","subject":"fatal error when merging a rename","startedAt":"2009-04-20T15:36:29Z","lastAt":"2009-04-20T15:36:29Z","messageCount":1,"participants":["Anders Melchiorsen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"111747","messageId":"57090.bFoQE3daRhY=.1240241789.squirrel@webmail.hotelhot.dk","threadId":"18970","inReplyTo":null,"subject":"fatal error when merging a rename","fromName":"Anders Melchiorsen","fromEmail":"mail@cup.kalibalik.dk","sentAt":"2009-04-20T15:36:29Z","receivedAt":"2009-04-20T15:36:29Z","isPatch":false,"sender":{"key":"mail@cup.kalibalik.dk","avatar":null},"body":"The talk of merge corner cases made me remember this issue:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/100859/focus=100956\n\n\nThe merge in the script below fails with this message:\n\nfatal: git write-tree failed to write a tree\n\nwhich is fixed by the (unapplied) patch from Alex in the thread above, but\nthe worktree is still not updated even with that patch.\n\n\nCheers,\nAnders.\n\n\n\n#!/bin/bash\n\nGIT=$(which git)\n\ncd $(mktemp -d am-merge-fail.XXXXXXX)\n$GIT init\n\nmkdir before\nyes | head -n100 >before/100\ntouch after\n$GIT add before/100 after\n$GIT commit -minitial\n\n$GIT branch parallel\n\n$GIT rm before/100 after\nmkdir after\nyes | head -n99 >after/99\n$GIT add after/99\n$GIT commit -mmove\n\n$GIT checkout parallel\necho \"Just to cause a non-ff\" >other\n$GIT add other\n$GIT commit -mparallel\n\n$GIT merge master\n"}]}