git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Rewrite the diff-no-index.c

From
Uubuntu2012@126.com <ubuntu2012@126.com>
Date
Mar 16, 2014, 12:44 UTC
Message-ID
<1394973858-16505-1-git-send-email-ubuntu2012@126.com>
From: 沈承恩 <ubuntu2012@126.com>
I am sorry for that I send this agian.Last patch I have some error.(Maybe this time will like the previous).It is apply for GSOC
Signed-off-by: 沈承恩 <ubuntu2012@126.com>
---
 diff-no-index.c |    5 +++--
 dir.h           |    3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/diff-no-index.c b/diff-no-index.c
index 8e10bff..1fb0c0f 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -3,13 +3,14 @@
  * Copyright (c) 2007 by Johannes Schindelin
  * Copyright (c) 2008 by Junio C Hamano
  */
-
+#define EXIT
 #include "cache.h"
 #include "color.h"
 #include "commit.h"
 #include "blob.h"
 #include "tag.h"
 #include "diff.h"
+#include "dir.h"
 #include "diffcore.h"
 #include "revision.h"
 #include "log-tree.h"
@@ -25,7 +26,7 @@ static int read_directory(const char *path, struct string_list *list)
 		return error("Could not open directory %s", path);
 
 	while ((e = readdir(dir)))
-		if (strcmp(".", e->d_name) && strcmp("..", e->d_name))
+		if (is_dot_or_dotdot(e->d_name))
 			string_list_insert(list, e->d_name);
 
 	closedir(dir);
diff --git a/dir.h b/dir.h
index 55e5345..c0e45c8 100644
--- a/dir.h
+++ b/dir.h
@@ -138,8 +138,9 @@ extern int match_pathspec(const struct pathspec *pathspec,
 extern int within_depth(const char *name, int namelen, int depth, int max_depth);
 
 extern int fill_directory(struct dir_struct *dir, const struct pathspec *pathspec);
+#ifndef EXIT
 extern int read_directory(struct dir_struct *, const char *path, int len, const struct pathspec *pathspec);
-
+#endif
 extern int is_excluded_from_list(const char *pathname, int pathlen, const char *basename,
 				 int *dtype, struct exclude_list *el);
 struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len);
-- 
1.7.9.5
Next: Eric Sunshine
Message 1 of 5 in “Rewrite the diff-no-index.c”
  1. Rewrite the diff-no-index.cubuntu2012@126.com, Mar 16, 2014
  2. Eric SunshineMar 17, 2014
  3. 沈承恩Mar 17, 2014
  4. 沈承恩Mar 17, 2014
  5. Matthieu MoyMar 17, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.