Move the struct ref_update definition and some enums to earlier in the file.
This does not change any actual code or definitions but just moves them
to a different place in the code since we will soon reference some of these
from the rename_ref function.

Signed-off-by: Ronnie Sahlberg <sahlb...@google.com>

Conflicts:
        refs.c
---
 refs.c | 61 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 30 insertions(+), 31 deletions(-)

diff --git a/refs.c b/refs.c
index 46a31c1..bcce8fe 100644
--- a/refs.c
+++ b/refs.c
@@ -2603,6 +2603,36 @@ static int rename_tmp_log(const char *newrefname)
        return 0;
 }
 
+enum transaction_update_type {
+       UPDATE_SHA1 = 0,
+       UPDATE_LOG = 1,
+};
+
+/**
+ * Information needed for a single ref update.  Set new_sha1 to the
+ * new value or to zero to delete the ref.  To check the old value
+ * while locking the ref, set have_old to 1 and set old_sha1 to the
+ * value or to zero to ensure the ref does not exist before update.
+ */
+struct ref_update {
+       enum transaction_update_type update_type;
+       unsigned char new_sha1[20];
+       unsigned char old_sha1[20];
+       int flags; /* REF_NODEREF? */
+       int have_old; /* 1 if old_sha1 is valid, 0 otherwise */
+       struct ref_lock *lock;
+       int type;
+       const char *msg;
+
+       /* used by reflog updates */
+       int reflog_fd;
+       struct lock_file *reflog_lock;
+       const char *committer;
+       struct ref_update *orig_update; /* For UPDATE_REFLOG_NOLOCK */
+
+       const char refname[FLEX_ARRAY];
+};
+
 int rename_ref(const char *oldrefname, const char *newrefname, const char 
*logmsg)
 {
        unsigned char sha1[20];
@@ -3254,37 +3284,6 @@ int for_each_reflog(each_ref_fn fn, void *cb_data)
        return retval;
 }
 
-enum transaction_update_type {
-       UPDATE_SHA1 = 0,
-       UPDATE_LOG = 1,
-};
-
-
-/**
- * Information needed for a single ref update.  Set new_sha1 to the
- * new value or to zero to delete the ref.  To check the old value
- * while locking the ref, set have_old to 1 and set old_sha1 to the
- * value or to zero to ensure the ref does not exist before update.
- */
-struct ref_update {
-       enum transaction_update_type update_type;
-       unsigned char new_sha1[20];
-       unsigned char old_sha1[20];
-       int flags; /* REF_NODEREF? or private flags */
-       int have_old; /* 1 if old_sha1 is valid, 0 otherwise */
-       struct ref_lock *lock;
-       int type;
-       const char *msg;
-
-       /* used by reflog updates */
-       int reflog_fd;
-       struct lock_file *reflog_lock;
-       const char *committer;
-       struct ref_update *orig_update; /* For UPDATE_REFLOG_NOLOCK */
-
-       const char refname[FLEX_ARRAY];
-};
-
 enum ref_transaction_status {
        REF_TRANSACTION_OPEN   = 0,
        REF_TRANSACTION_CLOSED = 1,
-- 
2.0.0.rc3.506.g3739a35

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to