clear_packed_ref_cache(): take a `packed_ref_store *` parameter
[gitweb.git] / builtin / grep.c
index 65070c52fc2da84bc48804817f1e714f755c9ab5..e64e14e945887a456566d78a54545d07d0462956 100644 (file)
@@ -1196,7 +1196,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                        break;
                }
 
-               object = parse_object_or_die(oid.hash, arg);
+               object = parse_object_or_die(&oid, arg);
                if (!seen_dashdash)
                        verify_non_filename(prefix, arg);
                add_object_array_with_path(object, arg, &list, oc.mode, oc.path);
@@ -1299,6 +1299,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                hit |= wait_all();
        if (hit && show_in_pager)
                run_pager(&opt, prefix);
+       clear_pathspec(&pathspec);
        free_grep_patterns(&opt);
        return !hit;
 }