Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  git-reset to remove "$GIT_DIR/MERGE_MSG"
  unpack-trees: make sure "df_conflict_entry.name" is NUL terminated.
  • Loading branch information
Junio C Hamano committed Dec 6, 2006
2 parents 4003a58 + 49ed2bc commit 2d13b73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion git-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 *));
Expand Down

0 comments on commit 2d13b73

Please sign in to comment.