X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=refs.c;h=eeb1196ec40a64e9ab1d865fbfc42b207fed98ed;hb=2b11e3170e919866c7f5554dd4089289a1bb6726;hp=d3ddc82d26ca72793e626204c246b8e5883153fa;hpb=d0740d92beb019a7b02678e5acea79c0ff67e3ee;p=git.git diff --git a/refs.c b/refs.c index d3ddc82d..eeb1196e 100644 --- a/refs.c +++ b/refs.c @@ -305,7 +305,7 @@ static struct ref_lock* lock_ref_sha1_basic(const char *path, 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);