Prevent buffer overflows when path is too long
[gitweb.git] / builtin / fetch.c
index 1514b908d85b27ab6a6e179f8a71d3786ad19b52..3d978eb58ec5cc1e2629db10562319c666bc031e 100644 (file)
@@ -360,9 +360,7 @@ static struct ref *get_ref_map(struct transport *transport,
                tail = &rm->next;
        }
 
-       ref_remove_duplicates(ref_map);
-
-       return ref_map;
+       return ref_remove_duplicates(ref_map);
 }
 
 #define STORE_REF_ERROR_OTHER 1
@@ -936,8 +934,8 @@ static void add_options_to_argv(struct argv_array *argv)
 {
        if (dry_run)
                argv_array_push(argv, "--dry-run");
-       if (prune > 0)
-               argv_array_push(argv, "--prune");
+       if (prune != -1)
+               argv_array_push(argv, prune ? "--prune" : "--no-prune");
        if (update_head_ok)
                argv_array_push(argv, "--update-head-ok");
        if (force)