diff options
author | Junio C Hamano <junkio@cox.net> | 2005-05-07 12:22:02 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-05-07 12:22:02 -0700 |
commit | 8eef4d3ed13d7604056b26ce58d0db007be530dd (patch) | |
tree | d80a3eea7b95b9ac11932ee6b6efe877fb5184cf /local-pull.c | |
parent | 36997b45adeb8915978de5a927130873073683dd (diff) | |
download | git-8eef4d3ed13d7604056b26ce58d0db007be530dd.tar.gz |
Notice index that has path and path/file and refuse to write such a tree.
Kay Sievers noticed that you can have both path and path/file in
the cache and write-tree happily creates a tree object from such
a state. Since a merge can result in such situation and the
user should be able to see the situation by looking at the
cache, rather than forbidding add_cache_entry() to create such
conflicts, fix it by making write-tree refuse to write such an
nonsensical tree. Here is a test case.
-- test case --
$ ls -a
./ ../
$ git-init-db
defaulting to local storage area
$ date >path
$ git-update-cache --add path
$ rm path
$ mkdir path
$ date >path/file
$ git-update-cache --add path/file
$ git-ls-files --stage
100644 1738f2536b1201218c41153941da065cc26174c9 0 path
100644 620c72f1c1de15f56ff9d63d6d7cdc69e828f1e3 0 path/file
$ git-ls-tree $(git-write-tree) ;# using old one
100644 blob 1738f2536b1201218c41153941da065cc26174c9 path
040000 tree ec116937f223e3df95aeac9f076902ae1618ae98 path
$ ../git-write-tree ;# using new one
You have both path and path/file
fatal: write-tree: not able to write tree
$ exit
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'local-pull.c')
0 files changed, 0 insertions, 0 deletions