From cfc5789ada444423232fa1533f401b5972eb3f6c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 25 Dec 2009 00:30:51 -0800 Subject: resolve-undo: record resolved conflicts in a new index extension section 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] " 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 --- resolve-undo.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 resolve-undo.h (limited to 'resolve-undo.h') diff --git a/resolve-undo.h b/resolve-undo.h new file mode 100644 index 000000000..74194d0eb --- /dev/null +++ b/resolve-undo.h @@ -0,0 +1,14 @@ +#ifndef RESOLVE_UNDO_H +#define RESOLVE_UNDO_H + +struct resolve_undo_info { + unsigned int mode[3]; + unsigned char sha1[3][20]; +}; + +extern void record_resolve_undo(struct index_state *, struct cache_entry *); +extern void resolve_undo_write(struct strbuf *, struct string_list *); +extern struct string_list *resolve_undo_read(void *, unsigned long); +extern void resolve_undo_clear_index(struct index_state *); + +#endif -- cgit v1.2.1