git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 2/3] refs.c: split delete_ref_loose() into a separate flag-for-deletion and commit phase

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 11, 2014, 21:51 UTC
Message-ID
<xmqqa9brr0uy.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1397248790-10403-3-git-send-email-sahlberg@google.com>
Ronnie Sahlberg <sahlberg@google.com> writes:
Show 17 quoted lines
>  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.

Previous: Ronnie SahlbergNext: Ronnie Sahlberg
Message 4 of 6 in “Make update refs more atomic”
  1. 0/3 Make update refs more atomicRonnie Sahlberg, Apr 11, 2014
  2. 1/3 refs.c: split writing and commiting a ref into two separate functionsRonnie Sahlberg, Apr 11, 2014
  3. 2/3 refs.c: split delete_ref_loose() into a separate flag-for-deletion and commit phaseRonnie Sahlberg, Apr 11, 2014
  4. Junio C HamanoApr 11, 2014
  5. 3/3 refs.c: change ref_transaction_commit to run the commit loops once all work is finishedRonnie Sahlberg, Apr 11, 2014
  6. Junio C HamanoApr 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.