summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-04-08 09:50:26 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-04-08 09:50:26 +0200
commit8f043d8a1d7f4076350ff0c778bfa60f7aa2f7aa (patch)
tree4d2a80c70fc35bf69d5779347c5e6802c8b9d0c9 /git/cmd.py
parentab7c3223076306ca71f692ed5979199863cf45a7 (diff)
downloadgitpython-8f043d8a1d7f4076350ff0c778bfa60f7aa2f7aa.tar.gz
fix(index): don't write extension data by default
It turned out that the index is not actually corrupted, which is good news. What happens is that `git` writes `TREE` extension data into the index, which causes it to write out the given tree *as is* next time a `git commit` is executed. When using `git add`, this extension data is maintained automatically. However, GitPython doesn't do that ... . Usually this is no problem at all, as you are supposed to use `IndexFile.commit(...)` along with `IndexFile.add(...)`. Thanks to a shortcoming in the GitPython API, the index was automatically written out whenever files have been added, without providing control over whether or not *extension data* will be written along with it. My fix consists of an additional flag in `IndexFile.add(...)`, which causes extension data not to be written by default, so commits can be safely done via `git commit` or `IndexFile.commit(...)`. However, this might introduce new subtle bugs in case someone is relying on extension data to be written. As this can be controlled through the said flag though, a fix is easily done in that case. Fixes #265
Diffstat (limited to 'git/cmd.py')
0 files changed, 0 insertions, 0 deletions