From: Junio C Hamano Date: Wed, 19 May 2010 05:39:56 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.7.2-rc0~134 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/636e87d705c2d6cc53d58eac31b689779d00b292?ds=inline;hp=-c Merge branch 'maint' * maint: Documentation/gitdiffcore: fix order in pickaxe description Documentation: fix minor inconsistency Documentation: rebase -i ignores options passed to "git am" hash_object: correction for zero length file --- 636e87d705c2d6cc53d58eac31b689779d00b292 diff --combined Documentation/config.txt index e5aa2cacfa,c3ebd4d07c..39140bad4d --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -481,8 -481,6 +481,8 @@@ core.whitespace: error (enabled by default). * `indent-with-non-tab` treats a line that is indented with 8 or more space characters as an error (not enabled by default). +* `tab-in-indent` treats a tab character in the initial indent part of + the line as an error (not enabled by default). * `blank-at-eof` treats blank lines added at the end of file as an error (enabled by default). * `trailing-space` is a short-hand to cover both `blank-at-eol` and @@@ -1270,13 -1268,6 +1270,13 @@@ log.date: following alternatives: {relative,local,default,iso,rfc,short}. See linkgit:git-log[1]. +log.decorate:: + Print out the ref names of any commits that are shown by the log + command. If 'short' is specified, the ref name prefixes 'refs/heads/', + 'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is + specified, the full ref name (including prefix) will be printed. + This is the same as the log commands '--decorate' option. + log.showroot:: If true, the initial commit will be shown as a big creation event. This is equivalent to a diff against an empty tree. @@@ -1525,7 -1516,7 +1525,7 @@@ receive.denyDeletes: the ref. Use this to prevent such a ref deletion via a push. receive.denyCurrentBranch:: - If set to true or "refuse", receive-pack will deny a ref update + If set to true or "refuse", git-receive-pack will deny a ref update to the currently checked out branch of a non-bare repository. Such a push is potentially dangerous because it brings the HEAD out of sync with the index and working tree. If set to "warn", @@@ -1651,7 -1642,6 +1651,7 @@@ sendemail.smtppass: sendemail.suppresscc:: sendemail.suppressfrom:: sendemail.to:: +sendemail.smtpdomain:: sendemail.smtpserver:: sendemail.smtpserverport:: sendemail.smtpuser:: diff --combined sha1_file.c index 28c056e074,1b551e4609..b2074e7a8e --- a/sha1_file.c +++ b/sha1_file.c @@@ -2448,6 -2448,8 +2448,8 @@@ int index_fd(unsigned char *sha1, int f else ret = -1; strbuf_release(&sbuf); + } else if (!size) { + ret = index_mem(sha1, NULL, size, write_object, type, path); } else if (size <= SMALL_FILE_SIZE) { char *buf = xmalloc(size); if (size == read_in_full(fd, buf, size)) @@@ -2456,12 -2458,11 +2458,11 @@@ else ret = error("short read %s", strerror(errno)); free(buf); - } else if (size) { + } else { void *buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); ret = index_mem(sha1, buf, size, write_object, type, path); munmap(buf, size); - } else - ret = index_mem(sha1, NULL, size, write_object, type, path); + } close(fd); return ret; } @@@ -2516,13 -2517,3 +2517,13 @@@ int read_pack_header(int fd, struct pac return PH_ERROR_PROTOCOL; return 0; } + +void assert_sha1_type(const unsigned char *sha1, enum object_type expect) +{ + enum object_type type = sha1_object_info(sha1, NULL); + if (type < 0) + die("%s is not a valid object", sha1_to_hex(sha1)); + if (type != expect) + die("%s is not a valid '%s' object", sha1_to_hex(sha1), + typename(expect)); +}