Skip to content

Commit 93f894c

Browse files
bk2204gitster
authored andcommitted
checkout: quote invalid treeish in error message
We received a report that invoking "git restore -source my_base_branch" resulted in the confusing error message "fatal: could not resolve ource". This looked like a typo in our error message, but it is actually because "-source" is missing its second dash and is being resolved as "-s ource". However, due to the lack of the quoting recommended in CodingGuidelines, this is confusing to the reader and we can do better. Add the necessary quoting to this message. With this change, we now get this less confusing message: fatal: could not resolve 'ource' Reported-by: Zhelyo Zhelev <zhelyo@gmail.com> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a1cf0cf commit 93f894c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
18751875
struct object_id rev;
18761876

18771877
if (repo_get_oid_mb(the_repository, opts->from_treeish, &rev))
1878-
die(_("could not resolve %s"), opts->from_treeish);
1878+
die(_("could not resolve '%s'"), opts->from_treeish);
18791879

18801880
setup_new_branch_info_and_source_tree(&new_branch_info,
18811881
opts, &rev,

0 commit comments

Comments
 (0)