Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Wed, 6 Dec 2006 18:47:37 +0000 (10:47 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 6 Dec 2006 18:47:37 +0000 (10:47 -0800)
* maint:
git-reset to remove "$GIT_DIR/MERGE_MSG"
unpack-trees: make sure "df_conflict_entry.name" is NUL terminated.

git-reset.sh
unpack-trees.c
index 3133b5bd25ca7ad3c2a5451ee9c2e0f4514cd980..c0feb4435d15da9cc9928800cbe270018f044152 100755 (executable)
@@ -63,6 +63,7 @@ case "$reset_type" in
        ;;
 esac
 
-rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" "$GIT_DIR/SQUASH_MSG"
+rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" \
+       "$GIT_DIR/SQUASH_MSG" "$GIT_DIR/MERGE_MSG"
 
 exit $update_ref_status
index 7cfd628d8e1c576115cb934e72138535fb7d2db3..47aa804a86d735d0fa84718708877ace962094bf 100644 (file)
@@ -370,7 +370,7 @@ int unpack_trees(struct object_list *trees, struct unpack_trees_options *o)
        int i;
        struct object_list *posn = trees;
        struct tree_entry_list df_conflict_list;
-       struct cache_entry df_conflict_entry;
+       static struct cache_entry *dfc;
 
        memset(&df_conflict_list, 0, sizeof(df_conflict_list));
        df_conflict_list.next = &df_conflict_list;
@@ -381,8 +381,10 @@ int unpack_trees(struct object_list *trees, struct unpack_trees_options *o)
        state.refresh_cache = 1;
 
        o->merge_size = len;
-       memset(&df_conflict_entry, 0, sizeof(df_conflict_entry));
-       o->df_conflict_entry = &df_conflict_entry;
+
+       if (!dfc)
+               dfc = xcalloc(1, sizeof(struct cache_entry) + 1);
+       o->df_conflict_entry = dfc;
 
        if (len) {
                posns = xmalloc(len * sizeof(struct tree_entry_list *));