[PATCH 1/2] peel_ref: rename "sha1" argument to "peeled"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "sha1" argument of peel_ref is meant to hold the peeled
object name for output. Let's call it "peeled" which makes
it more clear that it is not an input sha1 (especially as we
will be adding such an input sha1 in the next patch).

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
Simple cleanup for the next step.

 refs.c | 8 ++++----
 refs.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/refs.c b/refs.c
index de2d8eb..89f8141 100644
--- a/refs.c
+++ b/refs.c
@@ -1231,7 +1231,7 @@ static int filter_refs(const char *refname, const unsigned char *sha1, int flags
 	return filter->fn(refname, sha1, flags, filter->cb_data);
 }
 
-int peel_ref(const char *refname, unsigned char *sha1)
+int peel_ref(const char *refname, unsigned char *peeled)
 {
 	int flag;
 	unsigned char base[20];
@@ -1242,7 +1242,7 @@ int peel_ref(const char *refname, unsigned char *sha1)
 		if (current_ref->flag & REF_KNOWS_PEELED) {
 			if (is_null_sha1(current_ref->u.value.peeled))
 			    return -1;
-			hashcpy(sha1, current_ref->u.value.peeled);
+			hashcpy(peeled, current_ref->u.value.peeled);
 			return 0;
 		}
 		hashcpy(base, current_ref->u.value.sha1);
@@ -1257,7 +1257,7 @@ int peel_ref(const char *refname, unsigned char *sha1)
 		struct ref_entry *r = find_ref(dir, refname);
 
 		if (r != NULL && r->flag & REF_KNOWS_PEELED) {
-			hashcpy(sha1, r->u.value.peeled);
+			hashcpy(peeled, r->u.value.peeled);
 			return 0;
 		}
 	}
@@ -1274,7 +1274,7 @@ fallback:
 	if (o->type == OBJ_TAG) {
 		o = deref_tag_noverify(o);
 		if (o) {
-			hashcpy(sha1, o->sha1);
+			hashcpy(peeled, o->sha1);
 			return 0;
 		}
 	}
diff --git a/refs.h b/refs.h
index a35eafc..1e8b4e1 100644
--- a/refs.h
+++ b/refs.h
@@ -61,7 +61,7 @@ extern int ref_exists(const char *);
 
 extern int ref_exists(const char *);
 
-extern int peel_ref(const char *refname, unsigned char *sha1);
+extern int peel_ref(const char *refname, unsigned char *peeled);
 
 /** Locks a "refs/" ref returning the lock on success and NULL on failure. **/
 extern struct ref_lock *lock_ref_sha1(const char *refname, const unsigned char *old_sha1);
-- 
1.8.3.rc1.2.g12db477

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]