From: Junio C Hamano Date: Sun, 22 Apr 2007 00:38:00 +0000 (-0700) Subject: Merge branch 'jc/attr' X-Git-Tag: v1.5.2-rc0~18 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a2d7c6c62080b542007f9787342aa1e57b95f50c;p=git.git Merge branch 'jc/attr' * 'jc/attr': (28 commits) lockfile: record the primary process. convert.c: restructure the attribute checking part. Fix bogus linked-list management for user defined merge drivers. Simplify calling of CR/LF conversion routines Document gitattributes(5) Update 'crlf' attribute semantics. Documentation: support manual section (5) - file formats. Simplify code to find recursive merge driver. Counto-fix in merge-recursive Fix funny types used in attribute value representation Allow low-level driver to specify different behaviour during internal merge. Custom low-level merge driver: change the configuration scheme. Allow the default low-level merge driver to be configured. Custom low-level merge driver support. Add a demonstration/test of customized merge. Allow specifying specialized merge-backend per path. merge-recursive: separate out xdl_merge() interface. Allow more than true/false to attributes. Document git-check-attr Change attribute negation marker from '!' to '-'. ... --- a2d7c6c62080b542007f9787342aa1e57b95f50c diff --cc Makefile index 173c8b68c,e14cc1004..c9c2a5fb6 --- a/Makefile +++ b/Makefile @@@ -283,7 -283,7 +283,7 @@@ LIB_H = diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \ run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \ tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \ - utf8.h reflog-walk.h patch-ids.h decorate.h - utf8.h reflog-walk.h patch-ids.h attr.h ++ utf8.h reflog-walk.h patch-ids.h attr.h decorate.h DIFF_OBJS = \ diff.o diff-lib.o diffcore-break.o diffcore-order.o \ @@@ -305,7 -305,7 +305,7 @@@ LIB_OBJS = write_or_die.o trace.o list-objects.o grep.o match-trees.o \ alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ - convert.o decorate.o - convert.o attr.o ++ convert.o attr.o decorate.o BUILTIN_OBJS = \ builtin-add.o \ diff --cc entry.c index 50ffae40c,3771209f1..84f78025f --- a/entry.c +++ b/entry.c @@@ -78,17 -65,22 +78,17 @@@ static void *read_blob_entry(struct cac static int write_entry(struct cache_entry *ce, char *path, struct checkout *state, int to_tempfile) { int fd; - void *new; - unsigned long size; long wrote; - enum object_type type; - new = read_sha1_file(ce->sha1, &type, &size); - if (!new || type != OBJ_BLOB) { - if (new) - free(new); - return error("git-checkout-index: unable to read sha1 file of %s (%s)", - path, sha1_to_hex(ce->sha1)); - } switch (ntohl(ce->ce_mode) & S_IFMT) { - char *buf; + char *buf, *new; - unsigned long size, nsize; ++ unsigned long size; case S_IFREG: + new = read_blob_entry(ce, path, &size); + if (!new) + return error("git-checkout-index: unable to read sha1 file of %s (%s)", + path, sha1_to_hex(ce->sha1)); if (to_tempfile) { strcpy(path, ".merge_file_XXXXXX"); fd = mkstemp(path);