Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-01-27 08:26:48 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-27 23:09:34 +0300
commitd2ef3cb7e29c35362125a61f1d96576c200076f6 (patch)
tree3107566e1793e7c8ecd773214a132aab1ce2af41 /t/t1512-rev-parse-disambiguation.sh
parent851b3d7671778b74e40bf155c49f6b045f5eb4df (diff)
object-name: iterate ambiguous objects before showing header
Change the "The candidates are" header that's shown for ambiguous objects to be shown after we've iterated over all of the objects. If we get any errors while doing so we don't want to split up the the header and the list as a result. The two will now be printed together, as shown in the updated testcase. As we're accumulating the lines into as "struct strbuf" before emitting them we need to add a trailing newline to the call in show_ambiguous_object(). This and the change from "The candidates are:" to "The candidates are:\n%s" helps to give translators more context. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1512-rev-parse-disambiguation.sh')
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 0282ada133..be687aebb2 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -73,7 +73,6 @@ test_expect_success 'ambiguous loose bad object parsed as OBJ_BAD' '
test_cmp_failed_rev_parse blob.bad bad0 <<-\EOF
error: short object ID bad0... is ambiguous
- hint: The candidates are:
fatal: invalid object type
EOF
'
@@ -94,11 +93,11 @@ test_expect_success POSIXPERM 'ambigous zlib corrupt loose blob' '
test_cmp_failed_rev_parse blob.corrupt cafe <<-\EOF
error: short object ID cafe... is ambiguous
- hint: The candidates are:
error: inflate: data stream error (incorrect header check)
error: unable to unpack cafe... header
error: inflate: data stream error (incorrect header check)
error: unable to unpack cafe... header
+ hint: The candidates are:
hint: cafe... [bad object]
hint: cafe... blob
fatal: ambiguous argument '\''cafe...'\'': unknown revision or path not in the working tree.