diff options
author | Jeff King <peff@peff.net> | 2017-05-19 08:55:26 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-24 10:59:27 +0900 |
commit | 18f1ad76392e60cfaf68c3f1e49a4c91bd415d0d (patch) | |
tree | 8f67650ef4cc10a87579b36f20fbc2707e61b73d /Documentation/asciidoc.conf | |
parent | handle_revision_arg: record modes for "a..b" endpoints (diff) | |
download | tgif-18f1ad76392e60cfaf68c3f1e49a4c91bd415d0d.tar.xz |
handle_revision_arg: record paths for pending objects
If the revision parser sees an argument like tree:path, we
parse it down to the correct blob (or tree), but throw away
the "path" portion. Let's ask get_sha1_with_context() to
record it, and pass it along in the pending array.
This will let programs like git-diff which rely on the
revision-parser show more accurate paths.
Note that the implementation is a little tricky; we have to
make sure we free oc.path in all code paths. For handle_dotdot(),
we can piggy-back on the existing cleanup-wrapper pattern.
The real work happens in handle_dotdot_1(), but the
handle_dotdot() wrapper makes sure that the path is freed no
matter how we exit the function (and for that reason we make
sure that the object_context struct is zero'd, so if we fail
to even get to the get_sha1_with_context() call, we just end
up calling free(NULL)).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/asciidoc.conf')
0 files changed, 0 insertions, 0 deletions