projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Teach git push .git/branches shorthand
[git.git]
/
tree.c
diff --git
a/tree.c
b/tree.c
index
8dc27e3
..
8f490b8
100644
(file)
--- a/
tree.c
+++ b/
tree.c
@@
-21,9
+21,9
@@
static int read_one_entry(unsigned char *sha1, const char *base, int baselen, co
return add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
}
return add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
}
-static int match_tree_entry(const char *base, int baselen, const char *path, unsigned int mode, char **paths)
+static int match_tree_entry(const char *base, int baselen, const char *path, unsigned int mode, c
onst c
har **paths)
{
{
- char *match;
+ c
onst c
har *match;
int pathlen;
if (!paths)
int pathlen;
if (!paths)
@@
-59,13
+59,15
@@
static int match_tree_entry(const char *base, int baselen, const char *path, uns
if (strncmp(path, match, pathlen))
continue;
if (strncmp(path, match, pathlen))
continue;
+
+ return 1;
}
return 0;
}
static int read_tree_recursive(void *buffer, unsigned long size,
const char *base, int baselen,
}
return 0;
}
static int read_tree_recursive(void *buffer, unsigned long size,
const char *base, int baselen,
- int stage, char **match)
+ int stage, c
onst c
har **match)
{
while (size) {
int len = strlen(buffer)+1;
{
while (size) {
int len = strlen(buffer)+1;
@@
-115,7
+117,7
@@
static int read_tree_recursive(void *buffer, unsigned long size,
return 0;
}
return 0;
}
-int read_tree(void *buffer, unsigned long size, int stage, char **match)
+int read_tree(void *buffer, unsigned long size, int stage, c
onst c
har **match)
{
return read_tree_recursive(buffer, size, "", 0, stage, match);
}
{
return read_tree_recursive(buffer, size, "", 0, stage, match);
}
@@
-165,6
+167,7
@@
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size)
entry->directory = S_ISDIR(mode) != 0;
entry->executable = (mode & S_IXUSR) != 0;
entry->symlink = S_ISLNK(mode) != 0;
entry->directory = S_ISDIR(mode) != 0;
entry->executable = (mode & S_IXUSR) != 0;
entry->symlink = S_ISLNK(mode) != 0;
+ entry->zeropad = *(char *)bufptr == '0';
entry->mode = mode;
entry->next = NULL;
entry->mode = mode;
entry->next = NULL;