git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Check for lock failures early
@ 2014-04-16 18:56 Ronnie Sahlberg
  2014-04-16 18:56 ` [PATCH v2 1/2] sequencer.c: check for lock failure and bail early in fast_forward_to Ronnie Sahlberg
  2014-04-16 18:56 ` [PATCH v2 2/2] commit.c: check for lock error and return early Ronnie Sahlberg
  0 siblings, 2 replies; 6+ messages in thread
From: Ronnie Sahlberg @ 2014-04-16 18:56 UTC (permalink / raw)
  To: git; +Cc: mhagger, Ronnie Sahlberg

Callers outside of refs.c use either lock_ref_sha1() or 
lock_any_ref_for_update() to lock a ref during an update.

Two of these places we do not immediately check the lock for failure
making reading the code harder.

One place we do some unrelated string manipulation fucntions before we
check for failure and the other place we rely on that write_ref_sha1()
will check the lock for failure and return an error.


These two patches updates these two places so that we immediately check the
lock for failure and act on it.
It does not change any functionality or logic but makes the code easier to
read by being more consistent.

Version 2:
* Simplify the return on error case in sequencer.c.


Ronnie Sahlberg (2):
  sequencer.c: check for lock failure and bail early in fast_forward_to
  commit.c: check for lock error and return early

 builtin/commit.c | 8 ++++----
 sequencer.c      | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
1.9.1.504.g5a62d94

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-17 21:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 18:56 [PATCH v2 0/2] Check for lock failures early Ronnie Sahlberg
2014-04-16 18:56 ` [PATCH v2 1/2] sequencer.c: check for lock failure and bail early in fast_forward_to Ronnie Sahlberg
2014-04-16 22:03   ` Michael Haggerty
2014-04-16 18:56 ` [PATCH v2 2/2] commit.c: check for lock error and return early Ronnie Sahlberg
2014-04-16 22:06   ` Michael Haggerty
2014-04-17 21:09     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).