Comment 5 for bug 514573

Revision history for this message
methane (songofacandy) wrote : Re: unusual_modes drops when a file having unusual mode stays continuing revisions.

I've created a minimum testcase.

To reproduce the bug is:
1) create test git repository (attached gzip contains this)

inada-n@koala:~/test$ mkdir foo
inada-n@koala:~/test$ cd foo/
/home/inada-n/test/foo
inada-n@koala:~/test/foo$ git init
Initialized empty Git repository in /home/inada-n/test/foo/.git/
inada-n@koala:~/test/foo$ ln -s . foo
inada-n@koala:~/test/foo$ git add foo
inada-n@koala:~/test/foo$ git commit -m "add foo"
[master (root-commit) ca3de8b] add foo
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 120000 foo
inada-n@koala:~/test/foo$ cat .git/refs/heads/master
ca3de8bc2a701da35d7ff26d2a4b2dfeeec9e048
inada-n@koala:~/test/foo$ git ls-tree ca3de8bc2a701da35d7ff26d2a4b2dfeeec9e048
120000 blob 945c9b46d684f08ec84cb316e1dc0061e361f794 foo
inada-n@koala:~/test/foo$ git ls-tree ca3de8bc2a701da35d7ff26d2a4b2dfeeec9e048 > tree
inada-n@koala:~/test/foo$ vim tree #edit tree file
inada-n@koala:~/test/foo$ git mktree < tree
c7b0af5a3a158d8eeb88d3d333ad076895dd54d0
inada-n@koala:~/test/foo$ git ls-tree c7b0af5a3a158d8eeb88d3d333ad076895dd54d0
120777 blob 945c9b46d684f08ec84cb316e1dc0061e361f794 foo
inada-n@koala:~/test/foo$ echo "change mode" | git commit-tree c7b0af5a3a158d8eeb88d3d333ad076895dd54d0 -p ca3de8bc2a701da35d7ff26d2a4b2dfeeec9e048
912fbbb93aa51215867875fcff126885718ffcdf
inada-n@koala:~/test/foo$ echo "change mode take2" | git commit-tree c7b0af5a3a158d8eeb88d3d333ad076895dd54d0 -p 912fbbb93aa51215867875fcff126885718ffcdf
7b413dc8152fd1a35ce1552456af2ea884268c8f
inada-n@koala:~/test/foo$ echo 7b413dc8152fd1a35ce1552456af2ea884268c8f > .git/refs/heads/master
inada-n@koala:~/test/foo$ git log
commit 7b413dc8152fd1a35ce1552456af2ea884268c8f
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:28:42 2010 +0900

    change mode take2

commit 912fbbb93aa51215867875fcff126885718ffcdf
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:28:15 2010 +0900

    change mode

commit ca3de8bc2a701da35d7ff26d2a4b2dfeeec9e048
Author: Naoki INADA <email address hidden>
Date: Tue Feb 2 09:26:05 2010 +0900

    add foo

2)Make empty git repository and run git daemon.
$ cd ..
$ mkdir baz
$ cd baz
$ git init
$ cd ..
$ $ git daemon --export-all --enable=upload-pack --enable=receive-pack --base-path=$HOME/test

3) branch with bzr-git
inada-n@koala:~/test$ bzr branch git://localhost/foo/ bar
/ Counting objects: 6, done.
Branched 3 revision(s).
inada-n@koala:~/test$ cd bar
/home/inada-n/test/bar
inada-n@koala:~/test/bar$ rm .bzr/repository/git.db
inada-n@koala:~/test/bar$ bzr dpush git://localhost/baz/
bzr: ERROR: exceptions.AssertionError: recreated git commit had different sha1: expected 7b413dc8152fd1a35ce1552456af2ea884268c8f, got 368b0bb7ff8782ced333c386d874594614cb5913