diff options
author | David Turner <novalis@novalis.org> | 2019-01-18 05:19:43 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-19 00:22:02 +0100 |
commit | d1dd94b308607d0a37aa8a013fd20678956d3531 (patch) | |
tree | 76941b07caff798b7e8b45c05d7c88075b087f63 /tree-walk.c | |
parent | Third batch after 2.20 (diff) | |
download | git-d1dd94b308607d0a37aa8a013fd20678956d3531.tar.xz git-d1dd94b308607d0a37aa8a013fd20678956d3531.zip |
Do not print 'dangling' for cat-file in case of ambiguity
The return values -1 and -2 from get_oid could mean two different
things, depending on whether they were from an enum returned by
get_tree_entry_follow_symlinks, or from a different code path. This
caused 'dangling' to be printed from a git cat-file in the case of an
ambiguous (-2) result.
Unify the results of get_oid* and get_tree_entry_follow_symlinks to be
one common type, with unambiguous values.
Signed-off-by: David Turner <novalis@novalis.org>
Reported-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
-rw-r--r-- | tree-walk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tree-walk.c b/tree-walk.c index 08210a4109..fb7959b21d 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -579,10 +579,10 @@ int get_tree_entry(const struct object_id *tree_oid, const char *name, struct ob * with the sha1 of the found object, and *mode will hold the mode of * the object. * - * See the code for enum follow_symlink_result for a description of + * See the code for enum get_oid_result for a description of * the return values. */ -enum follow_symlinks_result get_tree_entry_follow_symlinks(struct object_id *tree_oid, const char *name, struct object_id *result, struct strbuf *result_path, unsigned *mode) +enum get_oid_result get_tree_entry_follow_symlinks(struct object_id *tree_oid, const char *name, struct object_id *result, struct strbuf *result_path, unsigned *mode) { int retval = MISSING_OBJECT; struct dir_state *parents = NULL; |