Skip to content

Commit f4470f2

Browse files
committed
Merge branch 'jt/upload-pack-error-report' into maint
"git upload-pack", which is a counter-part of "git fetch", did not report a request for a ref that was not advertised as invalid. This is generally not a problem (because "git fetch" will stop before making such a request), but is the right thing to do. * jt/upload-pack-error-report: upload-pack: report "not our ref" to client
2 parents e36e28e + bdb31ea commit f4470f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

upload-pack.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,13 @@ static void receive_needs(void)
822822
use_include_tag = 1;
823823

824824
o = parse_object(sha1_buf);
825-
if (!o)
825+
if (!o) {
826+
packet_write_fmt(1,
827+
"ERR upload-pack: not our ref %s",
828+
sha1_to_hex(sha1_buf));
826829
die("git upload-pack: not our ref %s",
827830
sha1_to_hex(sha1_buf));
831+
}
828832
if (!(o->flags & WANTED)) {
829833
o->flags |= WANTED;
830834
if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1

0 commit comments

Comments
 (0)