diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-24 12:39:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-24 12:39:21 -0700 |
commit | 8144049d79f2678eb6cee7bb9070341e3fcfe282 (patch) | |
tree | 6b59c21966cc4cee2b42f89a8c7ace853697a8c8 /argv-array.c | |
parent | f9db19214a15a1c384dd895ccda2a455824179cd (diff) | |
parent | 85566460897ee76555a7c90a951fe2d50272eb5e (diff) | |
download | git-8144049d79f2678eb6cee7bb9070341e3fcfe282.tar.gz |
Merge branch 'dj/fetch-all-tags' into maint
"git fetch --all", when passed "--no-tags", did not honor the
"--no-tags" option while fetching from individual remotes (the same
issue existed with "--tags", but combination "--all --tags" makes
much less sense than "--all --no-tags").
* dj/fetch-all-tags:
fetch --all: pass --tags/--no-tags through to each remote
submodule: use argv_array instead of hand-building arrays
fetch: use argv_array instead of hand-building arrays
argv-array: fix bogus cast when freeing array
argv-array: add pop function
Diffstat (limited to 'argv-array.c')
-rw-r--r-- | argv-array.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/argv-array.c b/argv-array.c index 0b5f8898a1..256741d226 100644 --- a/argv-array.c +++ b/argv-array.c @@ -49,12 +49,21 @@ void argv_array_pushl(struct argv_array *array, ...) va_end(ap); } +void argv_array_pop(struct argv_array *array) +{ + if (!array->argc) + return; + free((char *)array->argv[array->argc - 1]); + array->argv[array->argc - 1] = NULL; + array->argc--; +} + void argv_array_clear(struct argv_array *array) { if (array->argv != empty_argv) { int i; for (i = 0; i < array->argc; i++) - free((char **)array->argv[i]); + free((char *)array->argv[i]); free(array->argv); } argv_array_init(array); |