lockfile: rename LOCK_NODEREF to LOCK_NO_DEREF

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>

Michael Haggerty committed Oct 1, 2014 at 12:28 UTC 47ba4662bfd755829edd24428cf2e4bc492d70a6
4 files changed +5 -5
Documentation/technical/api-lockfile.txt
+2 -2
@@ -110,11 +110,11 @@ Flags
110 The following flags can be passed to `hold_lock_file_for_update` or
111 `hold_lock_file_for_append`:
112
113 -LOCK_NODEREF::
113 +LOCK_NO_DEREF::
114
115 Usually symbolic links in the destination path are resolved
116 and the lockfile is created by adding ".lock" to the resolved
117 - path. If `LOCK_NODEREF` is set, then the lockfile is created
117 + path. If `LOCK_NO_DEREF` is set, then the lockfile is created
118 by adding ".lock" to the path argument itself. This option is
119 used, for example, when locking a symbolic reference, which
120 for backwards-compatibility reasons can be a symbolic link
cache.h
+1 -1
@@ -583,7 +583,7 @@ struct lock_file {
583 struct strbuf filename;
584 };
585 #define LOCK_DIE_ON_ERROR 1
586 -#define LOCK_NODEREF 2
586 +#define LOCK_NO_DEREF 2
587 extern int unable_to_lock_error(const char *path, int err);
588 extern void unable_to_lock_message(const char *path, int err,
589 struct strbuf *buf);
lockfile.c
+1 -1
@@ -169,7 +169,7 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
169 }
170
171 strbuf_add(&lk->filename, path, pathlen);
172 - if (!(flags & LOCK_NODEREF))
172 + if (!(flags & LOCK_NO_DEREF))
173 resolve_symlink(&lk->filename);
174 strbuf_addstr(&lk->filename, LOCK_SUFFIX);
175 lk->fd = open(lk->filename.buf, O_RDWR | O_CREAT | O_EXCL, 0666);
refs.c
+1 -1
@@ -2192,7 +2192,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2192 lflags = 0;
2193 if (flags & REF_NODEREF) {
2194 refname = orig_refname;
2195 - lflags |= LOCK_NODEREF;
2195 + lflags |= LOCK_NO_DEREF;
2196 }
2197 lock->ref_name = xstrdup(refname);
2198 lock->orig_ref_name = xstrdup(orig_refname);