)]}' { "commit": "9a7bbd1dd1db45b474576ca328aa7056cdd081e0", "tree": "cb89f7147813ab167fa249ec681b143e1a737c92", "parents": [ "8c6b57860d9be5f346c9589a08c9e7c04eeaf99b" ], "author": { "name": "Jeff King", "email": "peff@peff.net", "time": "Mon Jun 16 12:15:02 2008 -0400" }, "committer": { "name": "Junio C Hamano", "email": "gitster@pobox.com", "time": "Wed Jun 18 12:39:13 2008 -0700" }, "message": "clean up error conventions of remote.c:match_explicit\n\nmatch_explicit is called for each push refspec to try to\nfully resolve the source and destination sides of the\nrefspec. Currently, we look at each refspec and report\nerrors on both the source and the dest side before aborting.\n\nIt makes sense to report errors for each refspec, since an\nerror in one is independent of an error in the other.\nHowever, reporting errors on the \u0027dst\u0027 side of a refspec if\nthere has been an error on the \u0027src\u0027 side does not\nnecessarily make sense, since the interpretation of the\n\u0027dst\u0027 side depends on the \u0027src\u0027 side (for example, when\ncreating a new unqualified remote ref, we use the same type\nas the src ref).\n\nThis patch lets match_explicit return early when the src\nside of the refspec is bogus. We still look at all of the\nrefspecs before aborting the push, though.\n\nAt the same time, we clean up the call signature, which\npreviously took an extra \"errs\" flag. This was pointless, as\nwe didn\u0027t act on that flag, but rather just passed it back\nto the caller. Instead, we now use the more traditional\n\"return -1\" to signal an error, and the caller aggregates\nthe error count.\n\nThis change fixes two bugs, as well:\n\n - the early return avoids a segfault when passing a NULL\n matched_src to guess_ref()\n\n - the check for multiple sources pointing to a single dest\n aborted if the \"err\" flag was set. Presumably the intent\n was not to bother with the check if we had no\n matched_src. However, since the err flag was passed in\n from the caller, we might abort the check just because a\n previous refspec had a problem, which doesn\u0027t make\n sense.\n\n In practice, this didn\u0027t matter, since due to the error\n flag we end up aborting the push anyway.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "91e3b112bb5ffa151a8ede9391d3bd88ea4d3500", "old_mode": 33188, "old_path": "remote.c", "new_id": "ff2c8021678fee5ef12060d35c6eb1960e8792c7", "new_mode": 33188, "new_path": "remote.c" }, { "type": "modify", "old_id": "6946557c677ccc190309cd5961b046c420174f7d", "old_mode": 33261, "old_path": "t/t5510-fetch.sh", "new_id": "df7750f7d1ede6e888ec3071397115022e067eb3", "new_mode": 33261, "new_path": "t/t5510-fetch.sh" } ] }