Skip to content

Commit c2e0a71

Browse files
mhaggergitster
authored andcommitted
ref_transaction_commit(): do not capitalize error messages
Our convention is for error messages to start with a lower-case letter. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 000f0da commit c2e0a71

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

refs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,7 +3922,7 @@ int ref_transaction_commit(struct ref_transaction *transaction,
39223922
? TRANSACTION_NAME_CONFLICT
39233923
: TRANSACTION_GENERIC_ERROR;
39243924
reason = strbuf_detach(err, NULL);
3925-
strbuf_addf(err, "Cannot lock ref '%s': %s",
3925+
strbuf_addf(err, "cannot lock ref '%s': %s",
39263926
update->refname, reason);
39273927
free(reason);
39283928
goto cleanup;
@@ -3945,7 +3945,7 @@ int ref_transaction_commit(struct ref_transaction *transaction,
39453945
* write_ref_to_lockfile():
39463946
*/
39473947
update->lock = NULL;
3948-
strbuf_addf(err, "Cannot update the ref '%s'.",
3948+
strbuf_addf(err, "cannot update the ref '%s'.",
39493949
update->refname);
39503950
ret = TRANSACTION_GENERIC_ERROR;
39513951
goto cleanup;

t/t1400-update-ref.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ test_expect_success 'stdin create ref works with path with space to blob' '
519519
test_expect_success 'stdin update ref fails with wrong old value' '
520520
echo "update $c $m $m~1" >stdin &&
521521
test_must_fail git update-ref --stdin <stdin 2>err &&
522-
grep "fatal: Cannot lock ref '"'"'$c'"'"'" err &&
522+
grep "fatal: cannot lock ref '"'"'$c'"'"'" err &&
523523
test_must_fail git rev-parse --verify -q $c
524524
'
525525

@@ -555,7 +555,7 @@ test_expect_success 'stdin update ref works with right old value' '
555555
test_expect_success 'stdin delete ref fails with wrong old value' '
556556
echo "delete $a $m~1" >stdin &&
557557
test_must_fail git update-ref --stdin <stdin 2>err &&
558-
grep "fatal: Cannot lock ref '"'"'$a'"'"'" err &&
558+
grep "fatal: cannot lock ref '"'"'$a'"'"'" err &&
559559
git rev-parse $m >expect &&
560560
git rev-parse $a >actual &&
561561
test_cmp expect actual
@@ -688,7 +688,7 @@ test_expect_success 'stdin update refs fails with wrong old value' '
688688
update $c ''
689689
EOF
690690
test_must_fail git update-ref --stdin <stdin 2>err &&
691-
grep "fatal: Cannot lock ref '"'"'$c'"'"'" err &&
691+
grep "fatal: cannot lock ref '"'"'$c'"'"'" err &&
692692
git rev-parse $m >expect &&
693693
git rev-parse $a >actual &&
694694
test_cmp expect actual &&
@@ -883,7 +883,7 @@ test_expect_success 'stdin -z create ref works with path with space to blob' '
883883
test_expect_success 'stdin -z update ref fails with wrong old value' '
884884
printf $F "update $c" "$m" "$m~1" >stdin &&
885885
test_must_fail git update-ref -z --stdin <stdin 2>err &&
886-
grep "fatal: Cannot lock ref '"'"'$c'"'"'" err &&
886+
grep "fatal: cannot lock ref '"'"'$c'"'"'" err &&
887887
test_must_fail git rev-parse --verify -q $c
888888
'
889889

@@ -899,7 +899,7 @@ test_expect_success 'stdin -z create ref fails when ref exists' '
899899
git rev-parse "$c" >expect &&
900900
printf $F "create $c" "$m~1" >stdin &&
901901
test_must_fail git update-ref -z --stdin <stdin 2>err &&
902-
grep "fatal: Cannot lock ref '"'"'$c'"'"'" err &&
902+
grep "fatal: cannot lock ref '"'"'$c'"'"'" err &&
903903
git rev-parse "$c" >actual &&
904904
test_cmp expect actual
905905
'
@@ -930,7 +930,7 @@ test_expect_success 'stdin -z update ref works with right old value' '
930930
test_expect_success 'stdin -z delete ref fails with wrong old value' '
931931
printf $F "delete $a" "$m~1" >stdin &&
932932
test_must_fail git update-ref -z --stdin <stdin 2>err &&
933-
grep "fatal: Cannot lock ref '"'"'$a'"'"'" err &&
933+
grep "fatal: cannot lock ref '"'"'$a'"'"'" err &&
934934
git rev-parse $m >expect &&
935935
git rev-parse $a >actual &&
936936
test_cmp expect actual
@@ -1045,7 +1045,7 @@ test_expect_success 'stdin -z update refs fails with wrong old value' '
10451045
git update-ref $c $m &&
10461046
printf $F "update $a" "$m" "$m" "update $b" "$m" "$m" "update $c" "$m" "$Z" >stdin &&
10471047
test_must_fail git update-ref -z --stdin <stdin 2>err &&
1048-
grep "fatal: Cannot lock ref '"'"'$c'"'"'" err &&
1048+
grep "fatal: cannot lock ref '"'"'$c'"'"'" err &&
10491049
git rev-parse $m >expect &&
10501050
git rev-parse $a >actual &&
10511051
test_cmp expect actual &&

0 commit comments

Comments
 (0)