Staging
v0.8.1
Revision f2d0df7148a1b9ee69bd69a365ffcd1965872451 authored by Shawn Bohrer on 15 April 2008, 03:14:09 UTC, committed by Junio C Hamano on 15 April 2008, 06:14:58 UTC
When git clean is run from a subdirectory it should follow the normal
policy and only remove directories if they are passed in as a pathspec,
or -d is specified.

The fix is to send len which could be shorter than ent->len because we
have stripped the trailing '/' that read_directory adds. Additionaly
match_one() was modified to allow a name[] that is not NUL terminated.
This allows us to check if the name matched the pathspec exactly
instead of recursively.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f669ac0
Raw File
path-list.h
#ifndef PATH_LIST_H
#define PATH_LIST_H

struct path_list_item {
	char *path;
	void *util;
};
struct path_list
{
	struct path_list_item *items;
	unsigned int nr, alloc;
	unsigned int strdup_paths:1;
};

void print_path_list(const char *text, const struct path_list *p);
void path_list_clear(struct path_list *list, int free_util);

/* Use these functions only on sorted lists: */
int path_list_has_path(const struct path_list *list, const char *path);
struct path_list_item *path_list_insert(const char *path, struct path_list *list);
struct path_list_item *path_list_lookup(const char *path, struct path_list *list);

/* Use these functions only on unsorted lists: */
struct path_list_item *path_list_append(const char *path, struct path_list *list);
void sort_path_list(struct path_list *list);
int unsorted_path_list_has_path(struct path_list *list, const char *path);

#endif /* PATH_LIST_H */
back to top