Re: [PATCH v2 12/14] sequencer: lib'ify save_head()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2016, 20:49 UTC
- Message-ID
- <xmqqy43f8fnc.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <729cf9d7cca4ec3fe9caeb6f21a322f3c68ce135.1472219214.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 5 quoted lines
> strbuf_addf(&buf, "%s\n", head);
> if (write_in_full(fd, buf.buf, buf.len) < 0)
> - die_errno(_("Could not write to %s"), git_path_head_file());
> + return error_errno(_("Could not write to %s"),
> + git_path_head_file());Same comment around a left-over lockfile applies to this. An extra rollback being minimally intrusive also applies here, I think.
Show 5 quoted lines
> if (commit_lock_file(&head_lock) < 0)
> - die(_("Error wrapping up %s."), git_path_head_file());
> + return error(_("Error wrapping up %s."), git_path_head_file());
> + return 0;
> }