summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4c7292)
raw | patch | inline | side by side (parent: e4c7292)
author | Kjetil Barvik <barvik@broadpark.no> | |
Mon, 9 Feb 2009 20:54:52 +0000 (21:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Feb 2009 04:59:26 +0000 (20:59 -0800) |
Currently inside show_patch_diff() we have an fstat() call after an
ok lstat() call. Since before the call to fstat() we have already
tested for the link case with S_ISLNK(), the fstat() can be removed.
Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ok lstat() call. Since before the call to fstat() we have already
tested for the link case with S_ISLNK(), the fstat() can be removed.
Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
combine-diff.c | patch | blob | history |
diff --git a/combine-diff.c b/combine-diff.c
index bccc018ab2666e769e7865d3cad1d61f04443700..4300319cc0fefe0d6f4eb599e24d89e0d01b8985 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
result_size = buf.len;
result = strbuf_detach(&buf, NULL);
elem->mode = canon_mode(st.st_mode);
- }
- else if (0 <= (fd = open(elem->path, O_RDONLY)) &&
- !fstat(fd, &st)) {
+ } else if (0 <= (fd = open(elem->path, O_RDONLY))) {
size_t len = xsize_t(st.st_size);
ssize_t done;
int is_file, i;