Skip to content

Commit 3553944

Browse files
mhaggergitster
authored andcommitted
ref_transaction_commit(): delete extra "the" from error message
While we are in the area, let's remove a superfluous definite article from the error message that is emitted when the reference cannot be locked. This improves how it reads and makes it a bit shorter. Signed-off-by: Michael Haggerty <[email protected]>
1 parent cbaabcb commit 3553944

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3844,7 +3844,7 @@ int ref_transaction_commit(struct ref_transaction *transaction,
38443844
? TRANSACTION_NAME_CONFLICT
38453845
: TRANSACTION_GENERIC_ERROR;
38463846
reason = strbuf_detach(err, NULL);
3847-
strbuf_addf(err, "Cannot lock the ref '%s': %s",
3847+
strbuf_addf(err, "Cannot lock ref '%s': %s",
38483848
update->refname, reason);
38493849
free(reason);
38503850
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 the 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 the 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 the 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 the 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 the 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 the 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 the 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)