#include "blob.h"
#include "delta.h"
#include "builtin.h"
-#include "path-list.h"
+#include "string-list.h"
/*
* --check turns on checking that the working tree matches the
static int line_termination = '\n';
static unsigned long p_context = ULONG_MAX;
static const char apply_usage[] =
-"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=<nowarn|warn|fix|error|error-all>] <patch>...";
+"git apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=<nowarn|warn|fix|error|error-all>] <patch>...";
static enum ws_error_action {
nowarn_ws_error,
* the case where more than one patches touch the same file.
*/
-static struct path_list fn_table;
+static struct string_list fn_table;
static uint32_t hash_line(const char *cp, size_t len)
{
static struct patch *in_fn_table(const char *name)
{
- struct path_list_item *item;
+ struct string_list_item *item;
if (name == NULL)
return NULL;
- item = path_list_lookup(name, &fn_table);
+ item = string_list_lookup(name, &fn_table);
if (item != NULL)
return (struct patch *)item->util;
static void add_to_fn_table(struct patch *patch)
{
- struct path_list_item *item;
+ struct string_list_item *item;
/*
* Always add new_name unless patch is a deletion
* file creations and copies
*/
if (patch->new_name != NULL) {
- item = path_list_insert(patch->new_name, &fn_table);
+ item = string_list_insert(patch->new_name, &fn_table);
item->util = patch;
}
* later chunks shouldn't patch old names
*/
if ((patch->new_name == NULL) || (patch->is_rename)) {
- item = path_list_insert(patch->old_name, &fn_table);
+ item = string_list_insert(patch->old_name, &fn_table);
item->util = (struct patch *) -1;
}
}
int skipped_patch = 0;
/* FIXME - memory leak when using multiple patch files as inputs */
- memset(&fn_table, 0, sizeof(struct path_list));
+ memset(&fn_table, 0, sizeof(struct string_list));
strbuf_init(&buf, 0);
patch_input_file = filename;
read_patch_file(&buf, fd);