Merge branch 'km/fetch-do-not-free-remote-name'
The ownership rule for the piece of memory that hold references to be fetched in "git fetch" was screwy, which has been cleaned up. * km/fetch-do-not-free-remote-name: builtin/fetch.c: don't free remote->name after fetch
This commit is contained in:
commit
845351c99b
@ -1005,7 +1005,7 @@ static int get_remote_group(const char *key, const char *value, void *priv)
|
|||||||
size_t wordlen = strcspn(value, " \t\n");
|
size_t wordlen = strcspn(value, " \t\n");
|
||||||
|
|
||||||
if (wordlen >= 1)
|
if (wordlen >= 1)
|
||||||
string_list_append(g->list,
|
string_list_append_nodup(g->list,
|
||||||
xstrndup(value, wordlen));
|
xstrndup(value, wordlen));
|
||||||
value += wordlen + (value[wordlen] != '\0');
|
value += wordlen + (value[wordlen] != '\0');
|
||||||
}
|
}
|
||||||
@ -1143,7 +1143,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
|
|||||||
int cmd_fetch(int argc, const char **argv, const char *prefix)
|
int cmd_fetch(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct string_list list = STRING_LIST_INIT_NODUP;
|
struct string_list list = STRING_LIST_INIT_DUP;
|
||||||
struct remote *remote;
|
struct remote *remote;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
|
struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
|
||||||
@ -1226,8 +1226,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
|
|||||||
argv_array_clear(&options);
|
argv_array_clear(&options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All names were strdup()ed or strndup()ed */
|
|
||||||
list.strdup_strings = 1;
|
|
||||||
string_list_clear(&list, 0);
|
string_list_clear(&list, 0);
|
||||||
|
|
||||||
close_all_packs();
|
close_all_packs();
|
||||||
|
Loading…
Reference in New Issue
Block a user