summaryrefslogtreecommitdiff
path: root/resolve-undo.h
AgeCommit message (Collapse)Author
2010-02-02build: make code "-Wpointer-arith" cleanJunio C Hamano
Recently introduced resolve_undo_read() expected arithmetic to (void *) to work on byte-addresses. Correct this. Noticed by Brandon Casey. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-26resolve-undo: "checkout -m path" uses resolve-undo informationJunio C Hamano
Once you resolved conflicts by "git add path", you cannot recreate the conflicted state with "git checkout -m path", because you lost information from higher stages in the index when you resolved them. Since we record the necessary information in the resolve-undo index extension these days, we can reproduce the unmerged state in the index and check it out. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-26resolve-undo: record resolved conflicts in a new index extension sectionJunio C Hamano
When resolving a conflict using "git add" to create a stage #0 entry, or "git rm" to remove entries at higher stages, remove_index_entry_at() function is eventually called to remove unmerged (i.e. higher stage) entries from the index. Introduce a "resolve_undo_info" structure and keep track of the removed cache entries, and save it in a new index extension section in the index_state. Operations like "read-tree -m", "merge", "checkout [-m] <branch>" and "reset" are signs that recorded information in the index is no longer necessary. The data is removed from the index extension when operations start; they may leave conflicted entries in the index, and later user actions like "git add" will record their conflicted states afresh. Signed-off-by: Junio C Hamano <gitster@pobox.com>