summaryrefslogtreecommitdiff
path: root/replace_object.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-14 14:27:06 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-14 14:27:06 -0700
commit3e30cb0fbf83fd35c70e9697ba8871420d9fed0a (patch)
tree340fcafc69da5a6d361f18c31ac0454595da1015 /replace_object.c
parentd552f8df1b2749b58e386dff98027c64f35cdbd1 (diff)
parent33bef7ea256e620c579aeff0e672b0becc79c75c (diff)
downloadgit-3e30cb0fbf83fd35c70e9697ba8871420d9fed0a.tar.gz
Merge branch 'mh/replace-refs-variable-rename'
* mh/replace-refs-variable-rename: Document some functions defined in object.c Add docstrings for lookup_replace_object() and do_lookup_replace_object() rename read_replace_refs to check_replace_refs
Diffstat (limited to 'replace_object.c')
-rw-r--r--replace_object.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/replace_object.c b/replace_object.c
index 6fc3ff47b1..4ee4c8d104 100644
--- a/replace_object.c
+++ b/replace_object.c
@@ -91,12 +91,19 @@ static void prepare_replace_object(void)
for_each_replace_ref(register_replace_ref, NULL);
replace_object_prepared = 1;
if (!replace_object_nr)
- read_replace_refs = 0;
+ check_replace_refs = 0;
}
/* We allow "recursive" replacement. Only within reason, though */
#define MAXREPLACEDEPTH 5
+/*
+ * If a replacement for object sha1 has been set up, return the
+ * replacement object's name (replaced recursively, if necessary).
+ * The return value is either sha1 or a pointer to a
+ * permanently-allocated value. This function always respects replace
+ * references, regardless of the value of check_replace_refs.
+ */
const unsigned char *do_lookup_replace_object(const unsigned char *sha1)
{
int pos, depth = MAXREPLACEDEPTH;