summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-01 19:45:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-01 19:45:16 (GMT)
commit67f0b6f3b2226ea858c616028375dcc3c46ccc37 (patch)
tree598a4db2b8e80916be9c2074490070bdd15e4df4 /cache.h
parent4ba5bb5531c6ec64a57ae2754ba51ce477eebaf0 (diff)
parent122d53464b29d3ac20891c5ee2f75ac5ecbb7b20 (diff)
downloadgit-67f0b6f3b2226ea858c616028375dcc3c46ccc37.zip
git-67f0b6f3b2226ea858c616028375dcc3c46ccc37.tar.gz
git-67f0b6f3b2226ea858c616028375dcc3c46ccc37.tar.bz2
Merge branch 'dt/cat-file-follow-symlinks'
"git cat-file --batch(-check)" learned the "--follow-symlinks" option that follows an in-tree symbolic link when asked about an object via extended SHA-1 syntax, e.g. HEAD:RelNotes that points at Documentation/RelNotes/2.5.0.txt. With the new option, the command behaves as if HEAD:Documentation/RelNotes/2.5.0.txt was given as input instead. * dt/cat-file-follow-symlinks: cat-file: add --follow-symlinks to --batch sha1_name: get_sha1_with_context learns to follow symlinks tree-walk: learn get_tree_entry_follow_symlinks
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/cache.h b/cache.h
index 9da9784..571c98f 100644
--- a/cache.h
+++ b/cache.h
@@ -971,15 +971,21 @@ struct object_context {
unsigned char tree[20];
char path[PATH_MAX];
unsigned mode;
+ /*
+ * symlink_path is only used by get_tree_entry_follow_symlinks,
+ * and only for symlinks that point outside the repository.
+ */
+ struct strbuf symlink_path;
};
-#define GET_SHA1_QUIETLY 01
-#define GET_SHA1_COMMIT 02
-#define GET_SHA1_COMMITTISH 04
-#define GET_SHA1_TREE 010
-#define GET_SHA1_TREEISH 020
-#define GET_SHA1_BLOB 040
-#define GET_SHA1_ONLY_TO_DIE 04000
+#define GET_SHA1_QUIETLY 01
+#define GET_SHA1_COMMIT 02
+#define GET_SHA1_COMMITTISH 04
+#define GET_SHA1_TREE 010
+#define GET_SHA1_TREEISH 020
+#define GET_SHA1_BLOB 040
+#define GET_SHA1_FOLLOW_SYMLINKS 0100
+#define GET_SHA1_ONLY_TO_DIE 04000
extern int get_sha1(const char *str, unsigned char *sha1);
extern int get_sha1_commit(const char *str, unsigned char *sha1);