Browse Source

Merge branch 'jk/maint-gc-auto-after-fetch' into jk/gc-auto-after-fetch

* jk/maint-gc-auto-after-fetch:
  fetch-pack: avoid repeatedly re-scanning pack directory
  fetch: run gc --auto after fetching
maint
Junio C Hamano 12 years ago
parent
commit
012a1bb524
  1. 5
      builtin/fetch.c
  2. 3
      fetch-pack.c

5
builtin/fetch.c

@ -959,6 +959,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) @@ -959,6 +959,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");

@ -1026,5 +1029,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) @@ -1026,5 +1029,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;
}

3
fetch-pack.c

@ -594,6 +594,9 @@ static int everything_local(struct fetch_pack_args *args, @@ -594,6 +594,9 @@ static int everything_local(struct fetch_pack_args *args,
for (ref = *refs; ref; ref = ref->next) {
struct object *o;

if (!has_sha1_file(ref->old_sha1))
continue;

o = parse_object(ref->old_sha1);
if (!o)
continue;

Loading…
Cancel
Save