From: Martin Koegler Date: Sat, 21 Apr 2007 12:26:20 GMT Subject: [PATCH 4/4] use the mode information of the tree, if :file name syntax is used Message-ID: <11771583802608-git-send-email-mkoegler@auto.tuwien.ac.at> In-Reply-To: <11771583803353-git-send-email-mkoegler@auto.tuwien.ac.at> Signed-off-by: Martin Koegler --- builtin-diff.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/builtin-diff.c b/builtin-diff.c index a427358..f1886ec 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -20,6 +20,7 @@ struct blobinfo { unsigned char sha1[20]; const char *name; + unsigned mode; }; static const char builtin_diff_usage[] = @@ -88,8 +89,14 @@ static int builtin_diff_blobs(struct rev_info *revs, if (argc > 1) usage(builtin_diff_usage); + if (blob[0].mode == S_IFINVALID) + blob[0].mode = mode; + + if (blob[1].mode == S_IFINVALID) + blob[1].mode = mode; + stuff_change(&revs->diffopt, - mode, mode, + blob[0].mode, blob[1].mode, blob[0].sha1, blob[1].sha1, blob[0].name, blob[1].name); diffcore_std(&revs->diffopt); @@ -271,6 +278,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) die("more than two blobs given: '%s'", name); hashcpy(blob[blobs].sha1, obj->sha1); blob[blobs].name = name; + blob[blobs].mode = list->mode; blobs++; continue; -- 1.4.4.4