Merge branch 'jk/gc-auto-after-fetch'
[gitweb.git] / builtin / fetch.c
index 3b97fc9bc64fb170bc512cc9054a1a3574a322ba..4b6b1dfe66952a7e3fb1516e7e14473febde3d2d 100644 (file)
@@ -962,6 +962,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
        struct string_list list = STRING_LIST_INIT_NODUP;
        struct remote *remote;
        int result = 0;
+       static const char *argv_gc_auto[] = {
+               "gc", "--auto", NULL,
+       };
 
        packet_trace_identity("fetch");
 
@@ -1041,5 +1044,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
        list.strdup_strings = 1;
        string_list_clear(&list, 0);
 
+       run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+
        return result;
 }