summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-07 06:05:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-07 06:05:21 (GMT)
commitcfd9167c15e7b09f3964204964a4c158108c6403 (patch)
tree678a4051a44c8931ea469123528679e9987d0689 /cache.h
parenta3d41733f9dd0d638d1538b54d516fed033c165b (diff)
parentdf799f5d99ac51d4fc791d546de3f936088582fc (diff)
downloadgit-cfd9167c15e7b09f3964204964a4c158108c6403.zip
git-cfd9167c15e7b09f3964204964a4c158108c6403.tar.gz
git-cfd9167c15e7b09f3964204964a4c158108c6403.tar.bz2
Merge branch 'dt/cat-file-batch-ambiguous'
"git cat-file --batch" reported a dangling symbolic link by mistake, when it wanted to report that a given name is ambiguous. * dt/cat-file-batch-ambiguous: t1512: test ambiguous cat-file --batch and --batch-output Do not print 'dangling' for cat-file in case of ambiguity
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 038e376..156a839 100644
--- a/cache.h
+++ b/cache.h
@@ -1345,6 +1345,24 @@ struct object_context {
GET_OID_TREE | GET_OID_TREEISH | \
GET_OID_BLOB)
+enum get_oid_result {
+ FOUND = 0,
+ MISSING_OBJECT = -1, /* The requested object is missing */
+ SHORT_NAME_AMBIGUOUS = -2,
+ /* The following only apply when symlinks are followed */
+ DANGLING_SYMLINK = -4, /*
+ * The initial symlink is there, but
+ * (transitively) points to a missing
+ * in-tree file
+ */
+ SYMLINK_LOOP = -5,
+ NOT_DIR = -6, /*
+ * Somewhere along the symlink chain, a path is
+ * requested which contains a file as a
+ * non-final element.
+ */
+};
+
extern int get_oid(const char *str, struct object_id *oid);
extern int get_oid_commit(const char *str, struct object_id *oid);
extern int get_oid_committish(const char *str, struct object_id *oid);
@@ -1352,7 +1370,7 @@ extern int get_oid_tree(const char *str, struct object_id *oid);
extern int get_oid_treeish(const char *str, struct object_id *oid);
extern int get_oid_blob(const char *str, struct object_id *oid);
extern void maybe_die_on_misspelt_object_name(const char *name, const char *prefix);
-extern int get_oid_with_context(const char *str, unsigned flags, struct object_id *oid, struct object_context *oc);
+extern enum get_oid_result get_oid_with_context(const char *str, unsigned flags, struct object_id *oid, struct object_context *oc);
typedef int each_abbrev_fn(const struct object_id *oid, void *);