From: Ronnie Sahlberg <sahlberg@google.com>
To: git@vger.kernel.org
Cc: mhagger@alum.mit.edu, Ronnie Sahlberg <sahlberg@google.com>
Subject: [PATCH 03/31] refs.c: rename the transaction functions
Date: Wed, 14 May 2014 15:13:02 -0700 [thread overview]
Message-ID: <1400105610-21194-4-git-send-email-sahlberg@google.com> (raw)
In-Reply-To: <1400105610-21194-1-git-send-email-sahlberg@google.com>
Rename the transaction functions. Remove the leading ref_ from the names
and append _sha1 to the names for functions that create/delete/update sha1
refs.
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
---
branch.c | 10 +++---
builtin/commit.c | 14 ++++----
builtin/fetch.c | 10 +++---
builtin/receive-pack.c | 10 +++---
builtin/replace.c | 10 +++---
builtin/tag.c | 10 +++---
builtin/update-ref.c | 22 ++++++------
fast-import.c | 22 ++++++------
refs.c | 92 +++++++++++++++++++++++++-------------------------
refs.h | 36 ++++++++++----------
sequencer.c | 12 +++----
walker.c | 14 ++++----
12 files changed, 131 insertions(+), 131 deletions(-)
diff --git a/branch.c b/branch.c
index 74d55e7..0a4d4f3 100644
--- a/branch.c
+++ b/branch.c
@@ -298,14 +298,14 @@ void create_branch(const char *head,
struct ref_transaction *transaction;
struct strbuf err = STRBUF_INIT;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, ref.buf, sha1,
- null_sha1, 0, !forcing, msg) ||
- ref_transaction_commit(transaction, &err))
+ transaction_update_sha1(transaction, ref.buf, sha1,
+ null_sha1, 0, !forcing, msg) ||
+ transaction_commit(transaction, &err))
die_errno(_("%s: failed to write ref: %s"),
ref.buf, err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
}
if (real_ref && track)
diff --git a/builtin/commit.c b/builtin/commit.c
index e6bb7b3..386dfb1 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1716,17 +1716,17 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
strbuf_insert(&sb, 0, reflog_msg, strlen(reflog_msg));
strbuf_insert(&sb, strlen(reflog_msg), ": ", 2);
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, "HEAD", sha1,
- current_head ?
- current_head->object.sha1 : NULL,
- 0, !!current_head, sb.buf) ||
- ref_transaction_commit(transaction, &err)) {
+ transaction_update_sha1(transaction, "HEAD", sha1,
+ current_head ?
+ current_head->object.sha1 : NULL,
+ 0, !!current_head, sb.buf) ||
+ transaction_commit(transaction, &err)) {
rollback_index_files();
die(_("HEAD: cannot update ref: %s"), err.buf);
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
unlink(git_path("CHERRY_PICK_HEAD"));
unlink(git_path("REVERT_HEAD"));
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 3a849b0..f74a267 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -383,8 +383,8 @@ static int s_update_ref(const char *action,
rla = default_rla.buf;
snprintf(msg, sizeof(msg), "%s: %s", rla, action);
- if (ref_transaction_update(transaction, ref->name, ref->new_sha1,
- ref->old_sha1, 0, check_old, msg))
+ if (transaction_update_sha1(transaction, ref->name, ref->new_sha1,
+ ref->old_sha1, 0, check_old, msg))
return STORE_REF_ERROR_OTHER;
return 0;
@@ -559,7 +559,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
}
errno = 0;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction) {
rc = error(_("cannot start ref transaction\n"));
goto abort;
@@ -676,10 +676,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
}
}
}
- if (ref_transaction_commit(transaction, NULL))
+ if (transaction_commit(transaction, NULL))
rc |= errno == ENOTDIR ? STORE_REF_ERROR_DF_CONFLICT :
STORE_REF_ERROR_OTHER;
- ref_transaction_free(transaction);
+ transaction_free(transaction);
if (rc & STORE_REF_ERROR_DF_CONFLICT)
error(_("some local refs could not be updated; try running\n"
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 991c659..0461f93 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -581,8 +581,8 @@ static const char *update(struct command *cmd, struct shallow_info *si)
update_shallow_ref(cmd, si))
return "shallow error";
- if (ref_transaction_update(transaction, namespaced_name,
- new_sha1, old_sha1, 0, 1, "push"))
+ if (transaction_update_sha1(transaction, namespaced_name,
+ new_sha1, old_sha1, 0, 1, "push"))
return "failed to update";
return NULL; /* good */
}
@@ -807,7 +807,7 @@ static void execute_commands(struct command *commands,
head_name = head_name_to_free = resolve_refdup("HEAD", sha1, 0, NULL);
checked_connectivity = 1;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
for (cmd = commands; cmd; cmd = cmd->next) {
if (cmd->error_string)
continue;
@@ -823,9 +823,9 @@ static void execute_commands(struct command *commands,
checked_connectivity = 0;
}
}
- if (ref_transaction_commit(transaction, &err))
+ if (transaction_commit(transaction, &err))
error("%s", err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
strbuf_release(&err);
if (shallow_update && !checked_connectivity)
diff --git a/builtin/replace.c b/builtin/replace.c
index 820d703..2587a06 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -157,14 +157,14 @@ static int replace_object_sha1(const char *object_ref,
else if (!force)
die("replace ref '%s' already exists", ref);
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, ref, repl, prev,
- 0, !is_null_sha1(prev), NULL) ||
- ref_transaction_commit(transaction, &err))
+ transaction_update_sha1(transaction, ref, repl, prev,
+ 0, !is_null_sha1(prev), NULL) ||
+ transaction_commit(transaction, &err))
die(_("%s: failed to replace ref: %s"), ref, err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
return 0;
}
diff --git a/builtin/tag.c b/builtin/tag.c
index 2cc260f..3739e23 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -702,13 +702,13 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
if (annotate)
create_tag(object, tag, &buf, &opt, prev, object);
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, ref.buf, object, prev,
- 0, !is_null_sha1(prev), NULL) ||
- ref_transaction_commit(transaction, &err))
+ transaction_update_sha1(transaction, ref.buf, object, prev,
+ 0, !is_null_sha1(prev), NULL) ||
+ transaction_commit(transaction, &err))
die(_("%s: cannot update the ref: %s"), ref.buf, err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
if (force && !is_null_sha1(prev) && hashcmp(prev, object))
printf(_("Updated tag '%s' (was %s)\n"), tag, find_unique_abbrev(prev, DEFAULT_ABBREV));
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index c5aff92..f7e33bd 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -198,8 +198,8 @@ static const char *parse_cmd_update(struct strbuf *input, const char *next)
if (*next != line_termination)
die("update %s: extra input: %s", refname, next);
- if (ref_transaction_update(transaction, refname, new_sha1, old_sha1,
- update_flags, have_old, msg))
+ if (transaction_update_sha1(transaction, refname, new_sha1, old_sha1,
+ update_flags, have_old, msg))
die("update %s: failed", refname);
update_flags = 0;
@@ -226,8 +226,8 @@ static const char *parse_cmd_create(struct strbuf *input, const char *next)
if (*next != line_termination)
die("create %s: extra input: %s", refname, next);
- if (ref_transaction_create(transaction, refname, new_sha1,
- update_flags, msg))
+ if (transaction_create_sha1(transaction, refname, new_sha1,
+ update_flags, msg))
die("failed transaction create for %s", refname);
update_flags = 0;
@@ -258,8 +258,8 @@ static const char *parse_cmd_delete(struct strbuf *input, const char *next)
if (*next != line_termination)
die("delete %s: extra input: %s", refname, next);
- if (ref_transaction_delete(transaction, refname, old_sha1,
- update_flags, have_old, msg))
+ if (transaction_delete_sha1(transaction, refname, old_sha1,
+ update_flags, have_old, msg))
die("failed transaction delete for %s", refname);
update_flags = 0;
@@ -291,8 +291,8 @@ static const char *parse_cmd_verify(struct strbuf *input, const char *next)
if (*next != line_termination)
die("verify %s: extra input: %s", refname, next);
- if (ref_transaction_update(transaction, refname, new_sha1, old_sha1,
- update_flags, have_old, msg))
+ if (transaction_update_sha1(transaction, refname, new_sha1, old_sha1,
+ update_flags, have_old, msg))
die("failed transaction update for %s", refname);
update_flags = 0;
@@ -366,15 +366,15 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
die("Refusing to perform update with empty message.");
if (read_stdin) {
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (delete || no_deref || argc > 0)
usage_with_options(git_update_ref_usage, options);
if (end_null)
line_termination = '\0';
update_refs_stdin();
- if (ref_transaction_commit(transaction, &err))
+ if (transaction_commit(transaction, &err))
die("%s", err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
return 0;
}
diff --git a/fast-import.c b/fast-import.c
index 099e71b..2fa1d29 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1707,17 +1707,17 @@ static int update_branch(struct branch *b)
return -1;
}
}
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, b->name, b->sha1, old_sha1,
- 0, 1, msg) ||
- ref_transaction_commit(transaction, &err)) {
- ref_transaction_rollback(transaction);
+ transaction_update_sha1(transaction, b->name, b->sha1, old_sha1,
+ 0, 1, msg) ||
+ transaction_commit(transaction, &err)) {
+ transaction_rollback(transaction);
error("Unable to update branch %s: %s", b->name, err.buf);
strbuf_release(&err);
return -1;
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
return 0;
}
@@ -1740,17 +1740,17 @@ static void dump_tags(void)
struct strbuf err = STRBUF_INIT;
struct ref_transaction *transaction;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
for (t = first_tag; t; t = t->next_tag) {
sprintf(ref_name, "refs/tags/%s", t->name);
- if (ref_transaction_update(transaction, ref_name, t->sha1,
- NULL, 0, 0, msg))
+ if (transaction_update_sha1(transaction, ref_name, t->sha1,
+ NULL, 0, 0, msg))
failure |= error("Unable to update %s", err.buf);
}
- if (failure || ref_transaction_commit(transaction, &err))
+ if (failure || transaction_commit(transaction, &err))
failure |= error("Unable to update %s", err.buf);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
strbuf_release(&err);
}
diff --git a/refs.c b/refs.c
index c180fa2..6785fa6 100644
--- a/refs.c
+++ b/refs.c
@@ -2357,17 +2357,17 @@ static void prune_ref(struct ref_to_prune *r)
if (check_refname_format(r->name + 5, 0))
return;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_delete(transaction, r->name, r->sha1,
- REF_ISPRUNING, 1, NULL) ||
- ref_transaction_commit(transaction, &err)) {
- ref_transaction_rollback(transaction);
+ transaction_delete_sha1(transaction, r->name, r->sha1,
+ REF_ISPRUNING, 1, NULL) ||
+ transaction_commit(transaction, &err)) {
+ transaction_rollback(transaction);
warning("prune_ref: %s", err.buf);
strbuf_release(&err);
return;
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
try_remove_empty_parents(r->name);
}
@@ -2521,15 +2521,15 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
{
struct ref_transaction *transaction;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_delete(transaction, refname, sha1, delopt,
- sha1 && !is_null_sha1(sha1), NULL) ||
- ref_transaction_commit(transaction, NULL)) {
- ref_transaction_rollback(transaction);
+ transaction_delete_sha1(transaction, refname, sha1, delopt,
+ sha1 && !is_null_sha1(sha1), NULL) ||
+ transaction_commit(transaction, NULL)) {
+ transaction_rollback(transaction);
return 1;
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
return 0;
}
@@ -2625,20 +2625,20 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
if (pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE))
return error("unable to pack refs");
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_delete(transaction, oldrefname, sha1,
- REF_NODEREF | REF_ISPACKONLY,
- 1, NULL) ||
- ref_transaction_update(transaction, newrefname, sha1,
- NULL, 0, 0, logmsg) ||
- ref_transaction_commit(transaction, &err)) {
- ref_transaction_rollback(transaction);
+ transaction_delete_sha1(transaction, oldrefname, sha1,
+ REF_NODEREF | REF_ISPACKONLY,
+ 1, NULL) ||
+ transaction_update_sha1(transaction, newrefname, sha1,
+ NULL, 0, 0, logmsg) ||
+ transaction_commit(transaction, &err)) {
+ transaction_rollback(transaction);
error("rename_ref failed: %s", err.buf);
strbuf_release(&err);
goto rollbacklog;
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
if (log && rename_tmp_log(newrefname))
goto rollbacklog;
@@ -3270,12 +3270,12 @@ struct ref_transaction {
enum ref_transaction_status status;
};
-struct ref_transaction *ref_transaction_begin(void)
+struct ref_transaction *transaction_begin(void)
{
return xcalloc(1, sizeof(struct ref_transaction));
}
-void ref_transaction_free(struct ref_transaction *transaction)
+void transaction_free(struct ref_transaction *transaction)
{
int i;
@@ -3290,14 +3290,14 @@ void ref_transaction_free(struct ref_transaction *transaction)
free(transaction);
}
-void ref_transaction_rollback(struct ref_transaction *transaction)
+void transaction_rollback(struct ref_transaction *transaction)
{
if (!transaction)
return;
transaction->status = REF_TRANSACTION_ERROR;
- ref_transaction_free(transaction);
+ transaction_free(transaction);
}
static struct ref_update *add_update(struct ref_transaction *transaction,
@@ -3312,11 +3312,11 @@ static struct ref_update *add_update(struct ref_transaction *transaction,
return update;
}
-int ref_transaction_update(struct ref_transaction *transaction,
+int transaction_update_sha1(struct ref_transaction *transaction,
const char *refname,
const unsigned char *new_sha1,
const unsigned char *old_sha1,
- int flags, int have_old, const char *msg)
+ int flags, int have_old, const char *msg)
{
struct ref_update *update;
@@ -3340,10 +3340,10 @@ int ref_transaction_update(struct ref_transaction *transaction,
return 0;
}
-int ref_transaction_create(struct ref_transaction *transaction,
- const char *refname,
- const unsigned char *new_sha1,
- int flags, const char *msg)
+int transaction_create_sha1(struct ref_transaction *transaction,
+ const char *refname,
+ const unsigned char *new_sha1,
+ int flags, const char *msg)
{
struct ref_update *update;
@@ -3356,14 +3356,14 @@ int ref_transaction_create(struct ref_transaction *transaction,
if (flags & REF_ISPACKONLY)
die("BUG: REF_ISPACKONLY can not be used with create");
- return ref_transaction_update(transaction, refname, new_sha1,
- null_sha1, flags, 1, msg);
+ return transaction_update_sha1(transaction, refname, new_sha1,
+ null_sha1, flags, 1, msg);
}
-int ref_transaction_delete(struct ref_transaction *transaction,
- const char *refname,
- const unsigned char *old_sha1,
- int flags, int have_old, const char *msg)
+int transaction_delete_sha1(struct ref_transaction *transaction,
+ const char *refname,
+ const unsigned char *old_sha1,
+ int flags, int have_old, const char *msg)
{
struct ref_update *update;
@@ -3376,8 +3376,8 @@ int ref_transaction_delete(struct ref_transaction *transaction,
if (transaction->status != REF_TRANSACTION_OPEN)
die("BUG: delete on transaction that is not open");
- return ref_transaction_update(transaction, refname, null_sha1,
- old_sha1, flags, have_old, msg);
+ return transaction_update_sha1(transaction, refname, null_sha1,
+ old_sha1, flags, have_old, msg);
}
int update_ref(const char *action, const char *refname,
@@ -3387,14 +3387,14 @@ int update_ref(const char *action, const char *refname,
struct ref_transaction *t;
struct strbuf err = STRBUF_INIT;
- t = ref_transaction_begin();
+ t = transaction_begin();
if (!t ||
- ref_transaction_update(t, refname, sha1, oldval, flags,
- !!oldval, action) ||
- ref_transaction_commit(t, &err)) {
+ transaction_update_sha1(t, refname, sha1, oldval, flags,
+ !!oldval, action) ||
+ transaction_commit(t, &err)) {
const char *str = "update_ref failed for ref '%s': %s";
- ref_transaction_rollback(t);
+ transaction_rollback(t);
switch (onerr) {
case UPDATE_REFS_MSG_ON_ERR:
error(str, refname, err.buf); break;
@@ -3405,7 +3405,7 @@ int update_ref(const char *action, const char *refname,
strbuf_release(&err);
return 1;
}
- ref_transaction_free(t);
+ transaction_free(t);
return 0;
}
@@ -3432,7 +3432,7 @@ static int ref_update_reject_duplicates(struct ref_update **updates, int n,
return 0;
}
-int ref_transaction_commit(struct ref_transaction *transaction,
+int transaction_commit(struct ref_transaction *transaction,
struct strbuf *err)
{
int ret = 0, delnum = 0, i;
diff --git a/refs.h b/refs.h
index 8d56edf..127c12f 100644
--- a/refs.h
+++ b/refs.h
@@ -213,12 +213,12 @@ enum action_on_err {
* eventually be freed by either calling ref_transaction_rollback()
* or ref_transaction_free().
*/
-struct ref_transaction *ref_transaction_begin(void);
+struct ref_transaction *transaction_begin(void);
/*
* Roll back a ref_transaction and free all associated data.
*/
-void ref_transaction_rollback(struct ref_transaction *transaction);
+void transaction_rollback(struct ref_transaction *transaction);
/*
@@ -239,11 +239,11 @@ void ref_transaction_rollback(struct ref_transaction *transaction);
* already exist and a new ref will be created with new_sha1.
* Function returns 0 on success and non-zero on failure.
*/
-int ref_transaction_update(struct ref_transaction *transaction,
- const char *refname,
- const unsigned char *new_sha1,
- const unsigned char *old_sha1,
- int flags, int have_old, const char *msg);
+int transaction_update_sha1(struct ref_transaction *transaction,
+ const char *refname,
+ const unsigned char *new_sha1,
+ const unsigned char *old_sha1,
+ int flags, int have_old, const char *msg);
/*
* Add a reference creation to transaction. new_sha1 is the value
@@ -252,10 +252,10 @@ int ref_transaction_update(struct ref_transaction *transaction,
* already.
* Function returns 0 on success and non-zero on failure.
*/
-int ref_transaction_create(struct ref_transaction *transaction,
- const char *refname,
- const unsigned char *new_sha1,
- int flags, const char *msg);
+int transaction_create_sha1(struct ref_transaction *transaction,
+ const char *refname,
+ const unsigned char *new_sha1,
+ int flags, const char *msg);
/*
* Add a reference deletion to transaction. If have_old is true, then
@@ -263,10 +263,10 @@ int ref_transaction_create(struct ref_transaction *transaction,
* the update (which must not be the null SHA-1).
* Function returns 0 on success and non-zero on failure.
*/
-int ref_transaction_delete(struct ref_transaction *transaction,
- const char *refname,
- const unsigned char *old_sha1,
- int flags, int have_old, const char *msg);
+int transaction_delete_sha1(struct ref_transaction *transaction,
+ const char *refname,
+ const unsigned char *old_sha1,
+ int flags, int have_old, const char *msg);
/*
* Commit all of the changes that have been queued in transaction, as
@@ -274,13 +274,13 @@ int ref_transaction_delete(struct ref_transaction *transaction,
* problem. If err is non-NULL we will add an error string to it to explain
* why the transaction failed. The string does not end in newline.
*/
-int ref_transaction_commit(struct ref_transaction *transaction,
- struct strbuf *err);
+int transaction_commit(struct ref_transaction *transaction,
+ struct strbuf *err);
/*
* Free an existing transaction.
*/
-void ref_transaction_free(struct ref_transaction *transaction);
+void transaction_free(struct ref_transaction *transaction);
/** Lock a ref and then write its file */
int update_ref(const char *action, const char *refname,
diff --git a/sequencer.c b/sequencer.c
index 3a0ee09..3f7996f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -282,18 +282,18 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,
strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction ||
- ref_transaction_update(transaction, "HEAD", to, from,
- 0, !unborn, sb.buf) ||
- ref_transaction_commit(transaction, &err)) {
- ref_transaction_rollback(transaction);
+ transaction_update_sha1(transaction, "HEAD", to, from,
+ 0, !unborn, sb.buf) ||
+ transaction_commit(transaction, &err)) {
+ transaction_rollback(transaction);
error(_("HEAD: Could not fast-forward: %s\n"), err.buf);
strbuf_release(&sb);
strbuf_release(&err);
return -1;
}
- ref_transaction_free(transaction);
+ transaction_free(transaction);
strbuf_release(&sb);
return 0;
diff --git a/walker.c b/walker.c
index c2a1266..3701c78 100644
--- a/walker.c
+++ b/walker.c
@@ -260,7 +260,7 @@ int walker_fetch(struct walker *walker, int targets, char **target,
save_commit_buffer = 0;
- transaction = ref_transaction_begin();
+ transaction = transaction_begin();
if (!transaction)
return -1;
@@ -289,14 +289,14 @@ int walker_fetch(struct walker *walker, int targets, char **target,
if (!write_ref || !write_ref[i])
continue;
sprintf(ref_name, "refs/%s", write_ref[i]);
- if (ref_transaction_update(transaction, ref_name,
- &sha1[20 * i], NULL,
- 0, 0,
- msg ? msg : "fetch (unknown)"))
+ if (transaction_update_sha1(transaction, ref_name,
+ &sha1[20 * i], NULL,
+ 0, 0,
+ msg ? msg : "fetch (unknown)"))
goto rollback_and_fail;
}
- if (ref_transaction_commit(transaction, &err)) {
+ if (transaction_commit(transaction, &err)) {
error("%s", err.buf);
goto rollback_and_fail;
}
@@ -307,7 +307,7 @@ int walker_fetch(struct walker *walker, int targets, char **target,
rollback_and_fail:
free(msg);
strbuf_release(&err);
- ref_transaction_free(transaction);
+ transaction_free(transaction);
return -1;
}
--
2.0.0.rc3.506.g3739a35
next prev parent reply other threads:[~2014-05-14 22:15 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 22:12 [PATCH 00/31] Finish implementing ref and reflog transactions Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 01/31] refs.c make ref_transaction_create a wrapper to ref_transaction_update Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 02/31] refs.c: make ref_transaction_delete a wrapper for ref_transaction_update Ronnie Sahlberg
2014-05-14 22:13 ` Ronnie Sahlberg [this message]
2014-05-16 21:15 ` [PATCH 03/31] refs.c: rename the transaction functions Junio C Hamano
2014-05-19 23:11 ` Ronnie Sahlberg
2014-05-19 23:25 ` Junio C Hamano
2014-05-14 22:13 ` [PATCH 04/31] refs.c: add a new update_type field to ref_update Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 05/31] refs.c: add a function to append a reflog entry to a fd Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 06/31] refs.c: add a transaction function to append a reflog entry Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 07/31] refs.c: add a flag to allow reflog updates to truncate the log Ronnie Sahlberg
2014-05-16 21:20 ` Junio C Hamano
2014-05-19 23:27 ` Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 08/31] refs.c: only write reflog update if msg is non-NULL Ronnie Sahlberg
2014-05-16 21:24 ` Junio C Hamano
2014-05-19 22:55 ` Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 09/31] refs.c: allow multiple reflog updates during a single transaction Ronnie Sahlberg
2014-05-16 21:35 ` Junio C Hamano
2014-05-16 22:01 ` Eric Sunshine
2014-05-19 22:58 ` Ronnie Sahlberg
2014-05-19 23:06 ` Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 10/31] reflog.c: use a reflog transaction when writing during expire Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 11/31] refs.c: null terminate the string in copy_msg Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 12/31] refs.c: track the refnames we are deleting in the transaction structure Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 13/31] refs.c: update the list of deleted refs during _update instead of _commit Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 14/31] refs.c: return error instead of dying when locking fails during transaction Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 15/31] refs.c: lock the ref during _update instead of during _commit Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 16/31] refs.c: add an error argument to create/delete/update just like commit Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 17/31] refs.c: make _update_reflog take an error argument Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 18/31] refs.c: return immediately from _commit if the transaction has an error Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 19/31] tests: move tests for -z update/delete/verify to after the ref is created Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 20/31] refs.c: check for lock conflicts already in _update Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 21/31] refs.c allow multiple updates of the same ref in a transaction Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 22/31] refs.c: release all remaining locks during transaction_free Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 23/31] reflog.c: use the existing transaction to also lock and update the ref Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 24/31] refs.c: make unlock_ref static Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 25/31] refs.c: make close_ref static Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 26/31] refs.c: make commit_ref static Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 27/31] refs.c: remove the function lock_any_ref_for_update Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 28/31] refs.c: make struct ref_lock private to refs.c Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 29/31] refs.c: allow passing raw git_committer_info as email to _update_reflog Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 30/31] refs.c: move ref_update and other definitions to earlier in the file Ronnie Sahlberg
2014-05-14 22:13 ` [PATCH 31/31] refs.c: use the transaction to manage the reflog in rename_refs Ronnie Sahlberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400105610-21194-4-git-send-email-sahlberg@google.com \
--to=sahlberg@google.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).