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

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

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Jun 18, 2014, 17:24 UTC
Message-ID
<1403112271-21331-3-git-send-email-sahlberg@google.com>
In-Reply-To
<1403112271-21331-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 11dcb07..a644e7c 100644
--- a/refs.c
+++ b/refs.c
@@ -2195,7 +2195,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.467.g08c0633
Previous: Ronnie SahlbergNext: Ronnie Sahlberg
Message 3 of 6 in “ref-transactions-rename”
  1. 0/5 ref-transactions-renameRonnie Sahlberg, Jun 18, 2014
  2. 1/5 refs.c: allow passing raw git_committer_info as email to _update_reflogRonnie Sahlberg, Jun 18, 2014
  3. 2/5 refs.c: return error instead of dying when locking fails during transactionRonnie Sahlberg, Jun 18, 2014
  4. 3/5 refs.c: use packed refs when deleting refs during a transactionRonnie Sahlberg, Jun 18, 2014
  5. 4/5 refs.c: update rename_ref to use a transactionRonnie Sahlberg, Jun 18, 2014
  6. 5/5 refs.c: rollback the lockfile before we die() in repack_without_refsRonnie Sahlberg, Jun 18, 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.