From: Junio C Hamano Date: Wed, 24 Aug 2016 17:49:56 GMT Subject: Re: [PATCH v2 3/4] cat-file --textconv/--filters: allow specifying the path separately Message-ID: In-Reply-To: Johannes Schindelin writes: > @@ -65,6 +68,11 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name, > if (get_sha1_with_context(obj_name, 0, sha1, &obj_context)) > die("Not a valid object name %s", obj_name); > > + if (!path) > + path = obj_context.path; > + else if (obj_context.mode == S_IFINVALID) > + obj_context.mode = 0100644; > + > buf = NULL; > switch (opt) { > case 't': Mentioned elsewhere, but I think the above should be if (!path) path = obj_context.path; if (obj_context.mode == S_IFINVALID) obj_context.mode = 0100644; IOW, even when there is an explicit path supplied, we should fall back to assumed "regular blob" mode, so that git cat-file --filters --path=README $(git rev-parse :README) would work as expected.