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 <jasampler@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Carlos Rica committed
Apr 18, 2007 at 05:34 UTC
1401f46bb42d1eb6225a5e08543c06a5b18fd3b7
2 files changed
+2
-2
cache.h
+1
-1
@@ -213,7 +213,7 @@ struct lock_file {
213
extern int hold_lock_file_for_update(struct lock_file *, const char *path, int);
214
extern int commit_lock_file(struct lock_file *);
215
extern void rollback_lock_file(struct lock_file *);
216
-extern int delete_ref(const char *, unsigned char *sha1);
216
+extern int delete_ref(const char *, const unsigned char *sha1);
217
218
/* Environment bits from configuration mechanism */
219
extern int use_legacy_headers;
refs.c
+1
-1
@@ -705,7 +705,7 @@ static int repack_without_ref(const char *refname)
705
return commit_lock_file(&packlock);
706
}
707
708
-int delete_ref(const char *refname, unsigned char *sha1)
708
+int delete_ref(const char *refname, const unsigned char *sha1)
709
{
710
struct ref_lock *lock;
711
int err, i, ret = 0, flag = 0;