summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cce91a2)
raw | patch | inline | side by side (parent: cce91a2)
author | Shawn Pearce <spearce@spearce.org> | |
Fri, 19 May 2006 09:15:28 +0000 (05:15 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 19 May 2006 22:02:59 +0000 (15:02 -0700) |
My earlier attempt at forcing a write for non-existant refs worked;
it forced a write for pretty much all refs. This corrects the
condition to only force a write for refs which don't exist yet.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
it forced a write for pretty much all refs. This corrects the
condition to only force a write for refs which don't exist yet.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
refs.c | patch | blob | history |
index d3ddc82d26ca72793e626204c246b8e5883153fa..eeb1196ec40a64e9ab1d865fbfc42b207fed98ed 100644 (file)
--- a/refs.c
+++ b/refs.c
lock->ref_file = strdup(path);
lock->lock_file = strdup(mkpath("%s.lock", lock->ref_file));
lock->log_file = strdup(git_path("logs/%s", lock->ref_file + plen));
- lock->force_write = !lstat(lock->ref_file, &st) || errno == ENOENT;
+ lock->force_write = lstat(lock->ref_file, &st) && errno == ENOENT;
if (safe_create_leading_directories(lock->lock_file))
die("unable to create directory for %s", lock->lock_file);