зеркало из https://github.com/microsoft/git.git
Merge branch 'jk/diff-blob' into maint
"git cat-file --textconv" started segfaulting recently, which has been corrected. * jk/diff-blob: cat-file: handle NULL object_context.path
This commit is contained in:
Коммит
16ba0f44c0
|
@ -96,7 +96,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
||||||
return !has_object_file(&oid);
|
return !has_object_file(&oid);
|
||||||
|
|
||||||
case 'w':
|
case 'w':
|
||||||
if (!path[0])
|
if (!path)
|
||||||
die("git cat-file --filters %s: <object> must be "
|
die("git cat-file --filters %s: <object> must be "
|
||||||
"<sha1:path>", obj_name);
|
"<sha1:path>", obj_name);
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
if (!path[0])
|
if (!path)
|
||||||
die("git cat-file --textconv %s: <object> must be <sha1:path>",
|
die("git cat-file --textconv %s: <object> must be <sha1:path>",
|
||||||
obj_name);
|
obj_name);
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,11 @@ test_expect_success '--path=<path> complains without --textconv/--filters' '
|
||||||
grep "path.*needs.*filters" err
|
grep "path.*needs.*filters" err
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success '--textconv/--filters complain without path' '
|
||||||
|
test_must_fail git cat-file --textconv HEAD &&
|
||||||
|
test_must_fail git cat-file --filters HEAD
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'cat-file --textconv --batch works' '
|
test_expect_success 'cat-file --textconv --batch works' '
|
||||||
sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
|
sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
|
||||||
test_config diff.txt.textconv "tr A-Za-z N-ZA-Mn-za-m <" &&
|
test_config diff.txt.textconv "tr A-Za-z N-ZA-Mn-za-m <" &&
|
||||||
|
|
Загрузка…
Ссылка в новой задаче