lockfile: rename LOCK_NODEREF to LOCK_NO_DEREF
authorMichael Haggerty <mhagger@alum.mit.edu>
Wed, 1 Oct 2014 10:28:37 +0000 (12:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Oct 2014 20:53:28 +0000 (13:53 -0700)
This makes it harder to misread the name as LOCK_NODE_REF.

Suggested-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-lockfile.txt
cache.h
lockfile.c
refs.c
index aa7d822900c04faee0d8f76e971823ad66181e24..a3cb69b968209cdab002753af151a0e990f74c7f 100644 (file)
@@ -110,11 +110,11 @@ Flags
 The following flags can be passed to `hold_lock_file_for_update` or
 `hold_lock_file_for_append`:
 
 The following flags can be passed to `hold_lock_file_for_update` or
 `hold_lock_file_for_append`:
 
-LOCK_NODEREF::
+LOCK_NO_DEREF::
 
        Usually symbolic links in the destination path are resolved
        and the lockfile is created by adding ".lock" to the resolved
 
        Usually symbolic links in the destination path are resolved
        and the lockfile is created by adding ".lock" to the resolved
-       path. If `LOCK_NODEREF` is set, then the lockfile is created
+       path. If `LOCK_NO_DEREF` is set, then the lockfile is created
        by adding ".lock" to the path argument itself. This option is
        used, for example, when locking a symbolic reference, which
        for backwards-compatibility reasons can be a symbolic link
        by adding ".lock" to the path argument itself. This option is
        used, for example, when locking a symbolic reference, which
        for backwards-compatibility reasons can be a symbolic link
diff --git a/cache.h b/cache.h
index 414e93ca6be2e1a3429d2ee13427a276bc4ef4a5..7ea4e81257f02c929f967f92e9098ee487c121f0 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -583,7 +583,7 @@ struct lock_file {
        struct strbuf filename;
 };
 #define LOCK_DIE_ON_ERROR 1
        struct strbuf filename;
 };
 #define LOCK_DIE_ON_ERROR 1
-#define LOCK_NODEREF 2
+#define LOCK_NO_DEREF 2
 extern int unable_to_lock_error(const char *path, int err);
 extern void unable_to_lock_message(const char *path, int err,
                                   struct strbuf *buf);
 extern int unable_to_lock_error(const char *path, int err);
 extern void unable_to_lock_message(const char *path, int err,
                                   struct strbuf *buf);
index cf7f4d0470e39a339bc1a34317756e8ec6df76a3..a1cc08a5ffce7b796ab47f73f9b8de997da369ac 100644 (file)
@@ -169,7 +169,7 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
        }
 
        strbuf_add(&lk->filename, path, pathlen);
        }
 
        strbuf_add(&lk->filename, path, pathlen);
-       if (!(flags & LOCK_NODEREF))
+       if (!(flags & LOCK_NO_DEREF))
                resolve_symlink(&lk->filename);
        strbuf_addstr(&lk->filename, LOCK_SUFFIX);
        lk->fd = open(lk->filename.buf, O_RDWR | O_CREAT | O_EXCL, 0666);
                resolve_symlink(&lk->filename);
        strbuf_addstr(&lk->filename, LOCK_SUFFIX);
        lk->fd = open(lk->filename.buf, O_RDWR | O_CREAT | O_EXCL, 0666);
diff --git a/refs.c b/refs.c
index 598f4eb9e7555304d170db738c40af830d4a91de..c10eaff57f212b336958bca5d468b69cd30c8415 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -2192,7 +2192,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
        lflags = 0;
        if (flags & REF_NODEREF) {
                refname = orig_refname;
        lflags = 0;
        if (flags & REF_NODEREF) {
                refname = orig_refname;
-               lflags |= LOCK_NODEREF;
+               lflags |= LOCK_NO_DEREF;
        }
        lock->ref_name = xstrdup(refname);
        lock->orig_ref_name = xstrdup(orig_refname);
        }
        lock->ref_name = xstrdup(refname);
        lock->orig_ref_name = xstrdup(orig_refname);