From: Junio C Hamano Date: Thu, 21 Aug 2025 20:47:00 +0000 (-0700) Subject: Merge branch 'dl/push-missing-object-error' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3636c3a1d3f2dd6f47669051e42dd7950bce6af4;p=thirdparty%2Fgit.git Merge branch 'dl/push-missing-object-error' "git push" had a code path that led to BUG() but it should have been a die(), as it is a response to a usual but invalid end-user action to attempt pushing an object that does not exist. * dl/push-missing-object-error: remote.c: convert if-else ladder to switch remote.c: remove BUG in show_push_unqualified_ref_name_error() t5516: remove surrounding empty lines in test bodies --- 3636c3a1d3f2dd6f47669051e42dd7950bce6af4 diff --cc remote.c index f108458035,398bfa6a95..81d8fc017e --- a/remote.c +++ b/remote.c @@@ -1196,8 -1181,9 +1195,9 @@@ static void show_push_unqualified_ref_n BUG("'%s' is not a valid object, " "match_explicit_lhs() should catch this!", matched_src_name); - type = odb_read_object_info(the_repository->objects, &oid, NULL); - if (type == OBJ_COMMIT) { + - switch (oid_object_info(the_repository, &oid, NULL)) { ++ switch (odb_read_object_info(the_repository->objects, &oid, NULL)) { + case OBJ_COMMIT: advise(_("The part of the refspec is a commit object.\n" "Did you mean to create a new branch by pushing to\n" "'%s:refs/heads/%s'?"),