Skip to content

Commit 47ba466

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 751bace commit 47ba466

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Documentation/technical/api-lockfile.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ Flags
110110
The following flags can be passed to `hold_lock_file_for_update` or
111111
`hold_lock_file_for_append`:
112112

113-
LOCK_NODEREF::
113+
LOCK_NO_DEREF::
114114

115115
Usually symbolic links in the destination path are resolved
116116
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
118118
by adding ".lock" to the path argument itself. This option is
119119
used, for example, when locking a symbolic reference, which
120120
for backwards-compatibility reasons can be a symbolic link

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ struct lock_file {
583583
struct strbuf filename;
584584
};
585585
#define LOCK_DIE_ON_ERROR 1
586-
#define LOCK_NODEREF 2
586+
#define LOCK_NO_DEREF 2
587587
extern int unable_to_lock_error(const char *path, int err);
588588
extern void unable_to_lock_message(const char *path, int err,
589589
struct strbuf *buf);

lockfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
169169
}
170170

171171
strbuf_add(&lk->filename, path, pathlen);
172-
if (!(flags & LOCK_NODEREF))
172+
if (!(flags & LOCK_NO_DEREF))
173173
resolve_symlink(&lk->filename);
174174
strbuf_addstr(&lk->filename, LOCK_SUFFIX);
175175
lk->fd = open(lk->filename.buf, O_RDWR | O_CREAT | O_EXCL, 0666);

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
21922192
lflags = 0;
21932193
if (flags & REF_NODEREF) {
21942194
refname = orig_refname;
2195-
lflags |= LOCK_NODEREF;
2195+
lflags |= LOCK_NO_DEREF;
21962196
}
21972197
lock->ref_name = xstrdup(refname);
21982198
lock->orig_ref_name = xstrdup(orig_refname);

0 commit comments

Comments
 (0)