summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-10-01 10:28:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-01 20:53:28 (GMT)
commit47ba4662bfd755829edd24428cf2e4bc492d70a6 (patch)
tree4f04a57b1fda2809d50625524fbe4907880b0854
parent751bacedaa507b7b6d10b2c1f48e019a01a8fa6e (diff)
downloadgit-47ba4662bfd755829edd24428cf2e4bc492d70a6.zip
git-47ba4662bfd755829edd24428cf2e4bc492d70a6.tar.gz
git-47ba4662bfd755829edd24428cf2e4bc492d70a6.tar.bz2
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>
-rw-r--r--Documentation/technical/api-lockfile.txt4
-rw-r--r--cache.h2
-rw-r--r--lockfile.c2
-rw-r--r--refs.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/technical/api-lockfile.txt b/Documentation/technical/api-lockfile.txt
index aa7d822..a3cb69b 100644
--- a/Documentation/technical/api-lockfile.txt
+++ b/Documentation/technical/api-lockfile.txt
@@ -110,11 +110,11 @@ Flags
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
- 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
diff --git a/cache.h b/cache.h
index 414e93c..7ea4e81 100644
--- a/cache.h
+++ b/cache.h
@@ -583,7 +583,7 @@ struct lock_file {
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);
diff --git a/lockfile.c b/lockfile.c
index cf7f4d0..a1cc08a 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -169,7 +169,7 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
}
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);
diff --git a/refs.c b/refs.c
index 598f4eb..c10eaff 100644
--- 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 |= LOCK_NODEREF;
+ lflags |= LOCK_NO_DEREF;
}
lock->ref_name = xstrdup(refname);
lock->orig_ref_name = xstrdup(orig_refname);