summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2013-05-10 17:10:16 +0200
committerJunio C Hamano <gitster@pobox.com>2013-05-10 10:27:34 -0700
commitafa15f3cd8f4cbf9572138329be374ff8566b10a (patch)
treeba8751467e428e397ec3e24ee648c3e1a4a520b5 /object.c
parent335ec3bf411ae6606b58885deb281192c86651c6 (diff)
downloadgit-afa15f3cd8f4cbf9572138329be374ff8566b10a.tar.gz
grep: honor --textconv for the case rev:pathmg/more-textconv
Make "grep" honor the "--textconv" option also for the object case, i.e. when used with an argument "rev:path". Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/object.c b/object.c
index 20703f52ed..c8ffc9e006 100644
--- a/object.c
+++ b/object.c
@@ -255,12 +255,7 @@ int object_list_contains(struct object_list *list, struct object *obj)
return 0;
}
-void add_object_array(struct object *obj, const char *name, struct object_array *array)
-{
- add_object_array_with_mode(obj, name, array, S_IFINVALID);
-}
-
-void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode)
+static void add_object_array_with_mode_context(struct object *obj, const char *name, struct object_array *array, unsigned mode, struct object_context *context)
{
unsigned nr = array->nr;
unsigned alloc = array->alloc;
@@ -275,9 +270,28 @@ void add_object_array_with_mode(struct object *obj, const char *name, struct obj
objects[nr].item = obj;
objects[nr].name = name;
objects[nr].mode = mode;
+ objects[nr].context = context;
array->nr = ++nr;
}
+void add_object_array(struct object *obj, const char *name, struct object_array *array)
+{
+ add_object_array_with_mode(obj, name, array, S_IFINVALID);
+}
+
+void add_object_array_with_mode(struct object *obj, const char *name, struct object_array *array, unsigned mode)
+{
+ add_object_array_with_mode_context(obj, name, array, mode, NULL);
+}
+
+void add_object_array_with_context(struct object *obj, const char *name, struct object_array *array, struct object_context *context)
+{
+ if (context)
+ add_object_array_with_mode_context(obj, name, array, context->mode, context);
+ else
+ add_object_array_with_mode_context(obj, name, array, S_IFINVALID, context);
+}
+
void object_array_remove_duplicates(struct object_array *array)
{
unsigned int ref, src, dst;