Git development
 help / color / mirror / Atom feed
From: ubuntu733 <ubuntu2012@126.com>
To: git@vger.kernel.org
Cc: ubuntu733 <ubuntu2012@126.com>
Subject: [PATCH] microproject for GSOC
Date: Sat, 15 Mar 2014 00:42:47 +0800	[thread overview]
Message-ID: <1394815367-9706-1-git-send-email-ubuntu2012@126.com> (raw)

Apply for GSOC.The microprojects is rewriter diff-index.c

Signed-off-by: ubuntu733 <ubuntu2012@126.com>
---
 diff-no-index.c |   11 ++++++-----
 dir.h           |    3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/diff-no-index.c b/diff-no-index.c
index 8e10bff..91ece64 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -3,7 +3,7 @@
  * Copyright (c) 2007 by Johannes Schindelin
  * Copyright (c) 2008 by Junio C Hamano
  */
-
+#define REMOVE 1
 #include "cache.h"
 #include "color.h"
 #include "commit.h"
@@ -24,10 +24,11 @@ static int read_directory(const char *path, struct string_list *list)
 	if (!(dir = opendir(path)))
 		return error("Could not open directory %s", path);
 
-	while ((e = readdir(dir)))
-		if (strcmp(".", e->d_name) && strcmp("..", e->d_name))
-			string_list_insert(list, e->d_name);
-
+	while ((e = readdir(dir))) {
+		while(is_dot_or_dotdot(e->d_name))
+                      break;
+		string_list_insert(list, e->d_name);
+              }
 	closedir(dir);
 	return 0;
 }
diff --git a/dir.h b/dir.h
index 55e5345..1d68818 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 REMOVE
 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

             reply	other threads:[~2014-03-14 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 16:42 ubuntu733 [this message]
2014-03-14 17:10 ` [PATCH] microproject for GSOC Matthieu Moy
2014-03-14 17:44   ` 沈承恩
2014-03-14 18:13   ` 沈承恩
2014-03-14 18:59     ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394815367-9706-1-git-send-email-ubuntu2012@126.com \
    --to=ubuntu2012@126.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox