aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-11-05 09:42:09 +0100
committerJunio C Hamano <gitster@pobox.com>2017-11-06 10:31:08 +0900
commit78fb457968591887ebb331d3d0475c00c7dbb317 (patch)
tree87d1ac511d33c92e1153e2cd73a046a5578eea25 /refs
parent417018826285140f9e948649ff9cf75a193075d2 (diff)
downloadgit-78fb457968591887ebb331d3d0475c00c7dbb317.tar.gz
git-78fb457968591887ebb331d3d0475c00c7dbb317.tar.xz
refs: update some more docs to use "oid" rather than "sha1"
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c19
-rw-r--r--refs/packed-backend.c2
-rw-r--r--refs/ref-cache.c4
-rw-r--r--refs/refs-internal.h18
4 files changed, 21 insertions, 22 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index bb10b715a..2298f900d 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -240,7 +240,7 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
} else if (is_null_oid(&oid)) {
/*
* It is so astronomically unlikely
- * that NULL_SHA1 is the SHA-1 of an
+ * that null_oid is the OID of an
* actual object that we consider its
* appearance in a loose reference
* file to be repo corruption
@@ -473,7 +473,7 @@ static void unlock_ref(struct ref_lock *lock)
* are passed to refs_verify_refname_available() for this check.
*
* If mustexist is not set and the reference is not found or is
- * broken, lock the reference anyway but clear sha1.
+ * broken, lock the reference anyway but clear old_oid.
*
* Return 0 on success. On failure, write an error message to err and
* return TRANSACTION_NAME_CONFLICT or TRANSACTION_GENERIC_ERROR.
@@ -1648,9 +1648,8 @@ static int files_log_ref_write(struct files_ref_store *refs,
}
/*
- * Write sha1 into the open lockfile, then close the lockfile. On
- * errors, rollback the lockfile, fill in *err and
- * return -1.
+ * Write oid into the open lockfile, then close the lockfile. On
+ * errors, rollback the lockfile, fill in *err and return -1.
*/
static int write_ref_to_lockfile(struct ref_lock *lock,
const struct object_id *oid, struct strbuf *err)
@@ -2272,7 +2271,7 @@ static int split_symref_update(struct files_ref_store *refs,
/*
* Change the symbolic ref update to log only. Also, it
- * doesn't need to check its old SHA-1 value, as that will be
+ * doesn't need to check its old OID value, as that will be
* done when new_update is processed.
*/
update->flags |= REF_LOG_ONLY | REF_NO_DEREF;
@@ -2341,7 +2340,7 @@ static int check_old_oid(struct ref_update *update, struct object_id *oid,
* Prepare for carrying out update:
* - Lock the reference referred to by update.
* - Read the reference under lock.
- * - Check that its old SHA-1 value (if specified) is correct, and in
+ * - Check that its old OID value (if specified) is correct, and in
* any case record it in update->lock->old_oid for later use when
* writing the reflog.
* - If it is a symref update without REF_NO_DEREF, split it up into a
@@ -2396,7 +2395,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
/*
* We won't be reading the referent as part of
* the transaction, so we have to read it here
- * to record and possibly check old_sha1:
+ * to record and possibly check old_oid:
*/
if (refs_read_ref_full(&refs->base,
referent.buf, 0,
@@ -2416,7 +2415,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
/*
* Create a new update for the reference this
* symref is pointing at. Also, we will record
- * and verify old_sha1 for this update as part
+ * and verify old_oid for this update as part
* of processing the split-off update, so we
* don't have to do it here.
*/
@@ -2436,7 +2435,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
/*
* If this update is happening indirectly because of a
- * symref update, record the old SHA-1 in the parent
+ * symref update, record the old OID in the parent
* update:
*/
for (parent_update = update->parent_update;
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index 43ad74fc5..72164a1d6 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -744,7 +744,7 @@ static int packed_read_raw_ref(struct ref_store *ref_store,
/*
* This value is set in `base.flags` if the peeled value of the
* current reference is known. In that case, `peeled` contains the
- * correct peeled value for the reference, which might be `null_sha1`
+ * correct peeled value for the reference, which might be `null_oid`
* if the reference is not a tag or if it is broken.
*/
#define REF_KNOWS_PEELED 0x40
diff --git a/refs/ref-cache.c b/refs/ref-cache.c
index 043eb8374..82c1cf90a 100644
--- a/refs/ref-cache.c
+++ b/refs/ref-cache.c
@@ -260,8 +260,8 @@ int add_ref_entry(struct ref_dir *dir, struct ref_entry *ref)
/*
* Emit a warning and return true iff ref1 and ref2 have the same name
- * and the same sha1. Die if they have the same name but different
- * sha1s.
+ * and the same oid. Die if they have the same name but different
+ * oids.
*/
static int is_dup_ref(const struct ref_entry *ref1, const struct ref_entry *ref2)
{
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index f9c6e72c9..dd834314b 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -15,13 +15,13 @@
*/
/*
- * The reference should be updated to new_sha1.
+ * The reference should be updated to new_oid.
*/
#define REF_HAVE_NEW (1 << 2)
/*
* The current reference's value should be checked to make sure that
- * it agrees with old_sha1.
+ * it agrees with old_oid.
*/
#define REF_HAVE_OLD (1 << 3)
@@ -86,7 +86,7 @@ enum peel_status {
* tag recursively until a non-tag is found. If successful, store the
* result to oid and return PEEL_PEELED. If the object is not a tag
* or is not valid, return PEEL_NON_TAG or PEEL_INVALID, respectively,
- * and leave sha1 unchanged.
+ * and leave oid unchanged.
*/
enum peel_status peel_object(const struct object_id *name, struct object_id *oid);
@@ -98,11 +98,11 @@ enum peel_status peel_object(const struct object_id *name, struct object_id *oid
int copy_reflog_msg(char *buf, const char *msg);
/**
- * Information needed for a single ref update. Set new_sha1 to the new
- * value or to null_sha1 to delete the ref. To check the old value
- * while the ref is locked, set (flags & REF_HAVE_OLD) and set
- * old_sha1 to the old value, or to null_sha1 to ensure the ref does
- * not exist before update.
+ * Information needed for a single ref update. Set new_oid to the new
+ * value or to null_oid to delete the ref. To check the old value
+ * while the ref is locked, set (flags & REF_HAVE_OLD) and set old_oid
+ * to the old value, or to null_oid to ensure the ref does not exist
+ * before update.
*/
struct ref_update {
/*
@@ -158,7 +158,7 @@ int ref_update_reject_duplicates(struct string_list *refnames,
/*
* Add a ref_update with the specified properties to transaction, and
* return a pointer to the new object. This function does not verify
- * that refname is well-formed. new_sha1 and old_sha1 are only
+ * that refname is well-formed. new_oid and old_oid are only
* dereferenced if the REF_HAVE_NEW and REF_HAVE_OLD bits,
* respectively, are set in flags.
*/