fetch: run gc --auto after fetching
[gitweb.git] / builtin / fetch.c
index f483352fe57c200415463078d834bd0712c22705..cffa3f73669db703b628ca46daec183b88a3f0a8 100644 (file)
@@ -960,6 +960,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");
 
@@ -1027,5 +1030,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;
 }