summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-05-20 17:03:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-20 20:46:13 (GMT)
commitc4ec96774ba247597bc4c571d85069d225665422 (patch)
tree791f6b1a950f26c31940ded018e94d332e23f7a3 /cache.h
parent275721c2671800a905e873e58be2f1c2f313bf88 (diff)
downloadgit-c4ec96774ba247597bc4c571d85069d225665422.zip
git-c4ec96774ba247597bc4c571d85069d225665422.tar.gz
git-c4ec96774ba247597bc4c571d85069d225665422.tar.bz2
sha1_name: get_sha1_with_context learns to follow symlinks
Wire up get_sha1_with_context to call get_tree_entry_follow_symlinks when GET_SHA1_FOLLOW_SYMLINKS is passed in flags. G_S_FOLLOW_SYMLINKS is incompatible with G_S_ONLY_TO_DIE because the diagnosis that ONLY_TO_DIE triggers does not at present consider symlinks, and it would be a significant amount of additional code to allow it to do so. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 b34447f..ec8d142 100644
--- a/cache.h
+++ b/cache.h
@@ -952,15 +952,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);