From: Junio C Hamano <gitster@pobox•com>
To: Ronnie Sahlberg <sahlberg@google•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH v3 2/3] refs.c: split delete_ref_loose() into a separate flag-for-deletion and commit phase
Date: Fri, 11 Apr 2014 14:51:33 -0700 [thread overview]
Message-ID: <xmqqa9brr0uy.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1397248790-10403-3-git-send-email-sahlberg@google.com> (Ronnie Sahlberg's message of "Fri, 11 Apr 2014 13:39:49 -0700")
Ronnie Sahlberg <sahlberg@google•com> writes:
> int commit_ref_lock(struct ref_lock *lock)
> {
> + if (lock->delete_ref) {
> + int flag = lock->delete_flag;
> +
> + if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) {
> + /* loose */
> + int err, i = strlen(lock->lk->filename) - 5; /* .lock */
> +
> + lock->lk->filename[i] = 0;
> + err = unlink_or_warn(lock->lk->filename);
> + lock->lk->filename[i] = '.';
> + if (err && errno != ENOENT)
> + return 1;
> + }
> + } else
> if (!lock->skipped_write && commit_ref(lock)) {
} else if (...) {
Also the previous patch indents the above "if" line in the context
with spaces; please use a tab.
next prev parent reply other threads:[~2014-04-11 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 20:39 [PATCH v3 0/3] Make update refs more atomic Ronnie Sahlberg
2014-04-11 20:39 ` [PATCH v3 1/3] refs.c: split writing and commiting a ref into two separate functions Ronnie Sahlberg
2014-04-11 20:39 ` [PATCH v3 2/3] refs.c: split delete_ref_loose() into a separate flag-for-deletion and commit phase Ronnie Sahlberg
2014-04-11 21:51 ` Junio C Hamano [this message]
2014-04-11 20:39 ` [PATCH v3 3/3] refs.c: change ref_transaction_commit to run the commit loops once all work is finished Ronnie Sahlberg
2014-04-11 22:27 ` [PATCH v3 0/3] Make update refs more atomic Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa9brr0uy.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=sahlberg@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox