From: Carlos Rica Date: Wed, 18 Apr 2007 03:34:34 +0000 (+0200) Subject: Use const qualifier for 'sha1' parameter in delete_ref function X-Git-Tag: v1.5.1.2~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1401f46bb42d1eb6225a5e08543c06a5b18fd3b7;p=git.git Use const qualifier for 'sha1' parameter in delete_ref function delete_ref function does not change the 'sha1' parameter. Non-const pointer causes a compiler warning if you call to the function using a const argument. Signed-off-by: Carlos Rica Signed-off-by: Junio C Hamano --- diff --git a/cache.h b/cache.h index 1904131f2..7cedda684 100644 --- a/cache.h +++ b/cache.h @@ -213,7 +213,7 @@ struct lock_file { extern int hold_lock_file_for_update(struct lock_file *, const char *path, int); extern int commit_lock_file(struct lock_file *); extern void rollback_lock_file(struct lock_file *); -extern int delete_ref(const char *, unsigned char *sha1); +extern int delete_ref(const char *, const unsigned char *sha1); /* Environment bits from configuration mechanism */ extern int use_legacy_headers; diff --git a/refs.c b/refs.c index d2b7b7fb5..d7be2841c 100644 --- a/refs.c +++ b/refs.c @@ -705,7 +705,7 @@ static int repack_without_ref(const char *refname) return commit_lock_file(&packlock); } -int delete_ref(const char *refname, unsigned char *sha1) +int delete_ref(const char *refname, const unsigned char *sha1) { struct ref_lock *lock; int err, i, ret = 0, flag = 0;