Skip to content

Commit b76846a

Browse files
committed
die: lowercase "Not a valid object name" messages
The CodingGuidelines state that error messages should not begin with a capital letter. Lowercase the "Not a valid object name" die() messages that appear in cat-file, describe, ls-tree, merge-base, read-tree, and unpack-file, and update the corresponding test expectations in t1006 and t8007. Signed-off-by: Md Ferdous Alam <mdferdousalam1989@yahoo.com>
1 parent 7c02d39 commit b76846a

8 files changed

Lines changed: 12 additions & 12 deletions

File tree

builtin/cat-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
121121

122122
if (get_oid_with_context(the_repository, obj_name, get_oid_flags, &oid,
123123
&obj_context))
124-
die("Not a valid object name %s", obj_name);
124+
die("not a valid object name %s", obj_name);
125125

126126
if (!path)
127127
path = obj_context.path;
@@ -182,7 +182,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
182182
case 'p':
183183
type = odb_read_object_info(the_repository->objects, &oid, NULL);
184184
if (type < 0)
185-
die("Not a valid object name %s", obj_name);
185+
die("not a valid object name %s", obj_name);
186186

187187
/* custom pretty-print here */
188188
if (type == OBJ_TREE) {

builtin/describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static void describe(const char *arg, int last_one)
606606
fprintf(stderr, _("describe %s\n"), arg);
607607

608608
if (repo_get_oid(the_repository, arg, &oid))
609-
die(_("Not a valid object name %s"), arg);
609+
die(_("not a valid object name %s"), arg);
610610
cmit = lookup_commit_reference_gently(the_repository, &oid, 1);
611611

612612
if (cmit)

builtin/ls-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ int cmd_ls_tree(int argc,
406406
usage_with_options(ls_tree_usage, ls_tree_options);
407407
if (repo_get_oid_with_flags(the_repository, argv[0], &oid,
408408
GET_OID_HASH_ANY))
409-
die("Not a valid object name %s", argv[0]);
409+
die("not a valid object name %s", argv[0]);
410410

411411
/*
412412
* show_recursive() rolls its own matching code and is

builtin/merge-base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static struct commit *get_commit_reference(const char *arg)
4747
struct commit *r;
4848

4949
if (repo_get_oid(the_repository, arg, &revkey))
50-
die("Not a valid object name %s", arg);
50+
die("not a valid object name %s", arg);
5151
r = lookup_commit_reference(the_repository, &revkey);
5252
if (!r)
5353
die("Not a valid commit name %s", arg);
@@ -131,7 +131,7 @@ static int handle_fork_point(int argc, const char **argv)
131131

132132
commitname = (argc == 2) ? argv[1] : "HEAD";
133133
if (repo_get_oid(the_repository, commitname, &oid))
134-
die("Not a valid object name: '%s'", commitname);
134+
die("not a valid object name: '%s'", commitname);
135135

136136
derived = lookup_commit_reference(the_repository, &oid);
137137

builtin/read-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ int cmd_read_tree(int argc,
210210
const char *arg = argv[i];
211211

212212
if (repo_get_oid(the_repository, arg, &oid))
213-
die("Not a valid object name %s", arg);
213+
die("not a valid object name %s", arg);
214214
if (list_tree(&oid) < 0)
215215
die("failed to unpack tree object %s", arg);
216216
stage++;

builtin/unpack-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int cmd_unpack_file(int argc,
4242
if (argc != 2)
4343
usage(usage_msg);
4444
if (repo_get_oid(the_repository, argv[1], &oid))
45-
die("Not a valid object name %s", argv[1]);
45+
die("not a valid object name %s", argv[1]);
4646

4747
repo_config(the_repository, git_default_config, NULL);
4848

t/t1006-cat-file.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ do
705705
then
706706
cat >expect <<-EOF
707707
error: header for $bogus_long_oid too long, exceeds 32 bytes
708-
fatal: Not a valid object name $bogus_long_oid
708+
fatal: not a valid object name $bogus_long_oid
709709
EOF
710710
else
711711
cat >expect <<-EOF
@@ -721,7 +721,7 @@ do
721721

722722
test_expect_success "cat-file $arg1 error on missing short OID" '
723723
cat >expect.err <<-EOF &&
724-
fatal: Not a valid object name $(test_oid deadbeef_short)
724+
fatal: not a valid object name $(test_oid deadbeef_short)
725725
EOF
726726
test_must_fail git cat-file $arg1 $(test_oid deadbeef_short) >out 2>err.actual &&
727727
test_must_be_empty out &&
@@ -732,7 +732,7 @@ do
732732
if test "$arg1" = "-p"
733733
then
734734
cat >expect.err <<-EOF
735-
fatal: Not a valid object name $(test_oid deadbeef)
735+
fatal: not a valid object name $(test_oid deadbeef)
736736
EOF
737737
else
738738
cat >expect.err <<-\EOF

t/t8007-cat-file-textconv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test_expect_success 'setup ' '
2222

2323
test_expect_success 'usage: <bad rev>' '
2424
cat >expect <<-\EOF &&
25-
fatal: Not a valid object name HEAD2
25+
fatal: not a valid object name HEAD2
2626
EOF
2727
test_must_fail git cat-file --textconv HEAD2 2>actual &&
2828
test_cmp expect actual

0 commit comments

Comments
 (0)