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

[PATCH 2/4] refs.c: return error instead of dying when locking fails during transaction

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Jun 5, 2014, 23:17 UTC
Message-ID
<1402010234-7628-3-git-send-email-sahlberg@google.com>
In-Reply-To
<1402010234-7628-1-git-send-email-sahlberg@google.com>

Change lock_ref_sha1_basic to return an error instead of dying when we fail to lock a file during a transaction.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
---
 refs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index e3a0383..ab0b629 100644
--- a/refs.c
+++ b/refs.c
@@ -2153,7 +2153,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
 			 */
 			goto retry;
 		else
-			unable_to_lock_index_die(ref_file, errno);
+			goto error_return;
 	}
 	return old_sha1 ? verify_lock(lock, old_sha1, mustexist) : lock;
 
-- 
2.0.0.583.g402232d
Previous: Ronnie SahlbergNext: Ronnie Sahlberg
Message 3 of 5 in “Use transactions for renames”
  1. 0/4 Use transactions for renamesRonnie Sahlberg, Jun 5, 2014
  2. 1/4 refs.c: allow passing raw git_committer_info as email to _update_reflogRonnie Sahlberg, Jun 5, 2014
  3. 2/4 refs.c: return error instead of dying when locking fails during transactionRonnie Sahlberg, Jun 5, 2014
  4. 3/4 refs.c: use packed refs when deleting refs during a transactionRonnie Sahlberg, Jun 5, 2014
  5. 4/4 refs.c: update rename_ref to use a transactionRonnie Sahlberg, Jun 5, 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.