X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=diff-tree.c;h=a6d358fb34cdae32917bd08ab8d3f7bb2d10f3a7;hb=3b42a63cb5845ef1c818f6b00e693c61469ee966;hp=db37aa714f0d0a7b0b2437ffb5b04351642f1e00;hpb=e3bc7a3bc7b77f44d686003f5a9346a135529f73;p=git.git diff --git a/diff-tree.c b/diff-tree.c index db37aa71..a6d358fb 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -44,10 +44,12 @@ static const unsigned char *extract(void *tree, unsigned long size, const char * int len = strlen(tree)+1; const unsigned char *sha1 = tree + len; const char *path = strchr(tree, ' '); + unsigned int mode; - if (!path || size < len + 20 || sscanf(tree, "%o", modep) != 1) + if (!path || size < len + 20 || sscanf(tree, "%o", &mode) != 1) die("corrupt tree file"); *pathp = path+1; + *modep = DIFF_FILE_CANON_MODE(mode); return sha1; }