Revision 28e77a81647584bfbe112f19e12e9952ab0b2fab authored by Junio C Hamano on 11 December 2005, 06:05:01 UTC, committed by Junio C Hamano on 11 December 2005, 09:47:15 UTC
This does two things.

 - When one branch renamed and the other branch did not, the
   resulting half-merged file in the working tree used to swap
   branches around and showed as if renaming side was "ours".
   This was confusing and inconsistent (even though the conflict
   markers were marked with branch names, it was not a good
   enough excuse).  This changes the order of arguments to
   mergeFile in such a case to make sure we always see "our"
   change between <<< and ===, and "their" change between ===
   and >>>.

 - When both branches renamed to the same path, and when one
   branch renamed and the other branch did not, we attempt
   mergeFile.  When this automerge conflicted, we used to
   collapse the index.  Now we use update-index --index-info
   to inject higher stage entries to leave the index in unmerged
   state for these two cases.

What this still does _not_ do is to inject unmerged state into
the index when the structural changes conflict.  I have not
thought things through what to do in each case yet, but the
cases this commit cover are the most common ones, so this would
be a good start.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 7564577
Raw File
tree.h
#ifndef TREE_H
#define TREE_H

#include "object.h"

extern const char *tree_type;

struct tree_entry_list {
	struct tree_entry_list *next;
	unsigned directory : 1;
	unsigned executable : 1;
	unsigned symlink : 1;
	unsigned zeropad : 1;
	unsigned int mode;
	char *name;
	union {
		struct object *any;
		struct tree *tree;
		struct blob *blob;
	} item;
};

struct tree {
	struct object object;
	struct tree_entry_list *entries;
};

struct tree *lookup_tree(const unsigned char *sha1);

int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);

int parse_tree(struct tree *tree);

/* Parses and returns the tree in the given ent, chasing tags and commits. */
struct tree *parse_tree_indirect(const unsigned char *sha1);

#define READ_TREE_RECURSIVE 1
typedef int (*read_tree_fn_t)(unsigned char *, const char *, int, const char *, unsigned int, int);

extern int read_tree_recursive(void *buffer, unsigned long size,
			const char *base, int baselen,
			int stage, const char **match,
			read_tree_fn_t fn);


#endif /* TREE_H */
back to top