unable_to_lock_die(): rename function from unable_to_lock_index_die()

This function is used for other things besides the index, so rename it accordingly. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Ronnie Sahlberg <sahlberg@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Oct 1, 2014 at 12:28 UTC e197c21807dacadc8305250baa0b9228819189d4
4 files changed +6 -6
builtin/update-index.c
+1 -1
@@ -942,7 +942,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
942 if (newfd < 0) {
943 if (refresh_args.flags & REFRESH_QUIET)
944 exit(128);
945 - unable_to_lock_index_die(get_index_file(), lock_error);
945 + unable_to_lock_die(get_index_file(), lock_error);
946 }
947 if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
948 die("Unable to write new index file");
cache.h
+1 -1
@@ -582,7 +582,7 @@ struct lock_file {
582 extern int unable_to_lock_error(const char *path, int err);
583 extern void unable_to_lock_message(const char *path, int err,
584 struct strbuf *buf);
585 -extern NORETURN void unable_to_lock_index_die(const char *path, int err);
585 +extern NORETURN void unable_to_lock_die(const char *path, int err);
586 extern int hold_lock_file_for_update(struct lock_file *, const char *path, int);
587 extern int hold_lock_file_for_append(struct lock_file *, const char *path, int);
588 extern int commit_lock_file(struct lock_file *);
lockfile.c
+3 -3
@@ -185,7 +185,7 @@ int unable_to_lock_error(const char *path, int err)
185 return -1;
186 }
187
188 -NORETURN void unable_to_lock_index_die(const char *path, int err)
188 +NORETURN void unable_to_lock_die(const char *path, int err)
189 {
190 struct strbuf buf = STRBUF_INIT;
191
@@ -198,7 +198,7 @@ int hold_lock_file_for_update(struct lock_file *lk, const char *path, int flags)
198 {
199 int fd = lock_file(lk, path, flags);
200 if (fd < 0 && (flags & LOCK_DIE_ON_ERROR))
201 - unable_to_lock_index_die(path, errno);
201 + unable_to_lock_die(path, errno);
202 return fd;
203 }
204
@@ -209,7 +209,7 @@ int hold_lock_file_for_append(struct lock_file *lk, const char *path, int flags)
209 fd = lock_file(lk, path, flags);
210 if (fd < 0) {
211 if (flags & LOCK_DIE_ON_ERROR)
212 - unable_to_lock_index_die(path, errno);
212 + unable_to_lock_die(path, errno);
213 return fd;
214 }
215
refs.c
+1 -1
@@ -2225,7 +2225,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2225 */
2226 goto retry;
2227 else
2228 - unable_to_lock_index_die(ref_file, errno);
2228 + unable_to_lock_die(ref_file, errno);
2229 }
2230 return old_sha1 ? verify_lock(lock, old_sha1, mustexist) : lock;
2231