int count, int base_name)
{
int i;
- int len = prefix ? strlen(prefix) : 0;
const char **result = xmalloc((count + 1) * sizeof(const char *));
memcpy(result, pathspec, count * sizeof(const char *));
result[count] = NULL;
if (last_slash)
result[i] = last_slash + 1;
}
- result[i] = prefix_path(prefix, len, result[i]);
- if (!result[i])
- exit(1); /* error already given */
}
- return result;
+ return get_pathspec(prefix, result);
}
static void show_list(const char *label, struct path_list *list)
struct path_list deleted = {NULL, 0, 0, 0};
struct path_list changed = {NULL, 0, 0, 0};
- git_config(git_default_config);
+ git_config(git_default_config, NULL);
newfd = hold_locked_index(&lock_file, 1);
if (read_cache() < 0)
for (i = 0; i < added.nr; i++) {
const char *path = added.items[i].path;
- add_file_to_cache(path, verbose);
+ if (add_file_to_cache(path, verbose ? ADD_CACHE_VERBOSE : 0))
+ die("updating index entries failed");
}
for (i = 0; i < deleted.nr; i++)