From 08bda2085cc095863888bb4bb7a73960a9a379fd Mon Sep 17 00:00:00 2001 From: Dmitry Potapov Date: Tue, 11 May 2010 01:38:17 +0400 Subject: hash_object: correction for zero length file The check whether size is zero was done after if size <= SMALL_FILE_SIZE, as result, zero size case was never triggered. Instead zero length file was treated as any other small file. This did not caused any problem, but if we have a special case for size equal to zero, it is better to make it work and avoid redundant malloc(). Signed-off-by: Dmitry Potapov Signed-off-by: Junio C Hamano --- sha1_file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index ff65328006..1b551e4609 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2448,6 +2448,8 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, 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 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, 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; } -- cgit v1.2.3 From 56a05720b1c2d5f82d4a3db4142b7a027cf8f3f7 Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Thu, 13 May 2010 14:47:53 +0200 Subject: Documentation: rebase -i ignores options passed to "git am" Signed-off-by: Markus Heidelberg Signed-off-by: Junio C Hamano --- Documentation/git-rebase.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 0d07b1b207..5863decdc9 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -295,6 +295,7 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details). --ignore-date:: These flags are passed to 'git am' to easily change the dates of the rebased commits (see linkgit:git-am[1]). + Incompatible with the --interactive option. -i:: --interactive:: -- cgit v1.2.3 From f3838ce16aaa8ab576a78c980b0962226f6e7a33 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 13 May 2010 14:51:38 +0200 Subject: Documentation: fix minor inconsistency While we don't always write out commands in full (`git command`) we should do it consistently in adjacent paragraphs. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 8f86050b05..c3ebd4d07c 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1516,7 +1516,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", -- cgit v1.2.3 From d07ef715757ab1c2436c59adca92484fa46b2b41 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 18 May 2010 12:49:33 +0200 Subject: Documentation/gitdiffcore: fix order in pickaxe description Reverse the order of "origin" and "result" so that the sentence really describes an addition rather than a removal. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/gitdiffcore.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 9de8caf5d1..5d91a7e5b3 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -227,8 +227,8 @@ changes that touch a specified string, and is controlled by the commands. When diffcore-pickaxe is in use, it checks if there are -filepairs whose "original" side has the specified string and -whose "result" side does not. Such a filepair represents "the +filepairs whose "result" side has the specified string and +whose "origin" side does not. Such a filepair represents "the string appeared in this changeset". It also checks for the opposite case that loses the specified string. -- cgit v1.2.3