Merge branch 'sg/travis-fixes'
[gitweb.git] / builtin / update-ref.c
index 6b90c5deadb62600aa08166f500bde24cb800fbf..cf1552b47850f5f74b07051e6c114d6351d590be 100644 (file)
@@ -200,7 +200,7 @@ static const char *parse_cmd_update(struct ref_transaction *transaction,
                die("update %s: extra input: %s", refname, next);
 
        if (ref_transaction_update(transaction, refname,
-                                  new_oid.hash, have_old ? old_oid.hash : NULL,
+                                  &new_oid, have_old ? &old_oid : NULL,
                                   update_flags | create_reflog_flag,
                                   msg, &err))
                die("%s", err.buf);
@@ -232,7 +232,7 @@ static const char *parse_cmd_create(struct ref_transaction *transaction,
        if (*next != line_termination)
                die("create %s: extra input: %s", refname, next);
 
-       if (ref_transaction_create(transaction, refname, new_oid.hash,
+       if (ref_transaction_create(transaction, refname, &new_oid,
                                   update_flags | create_reflog_flag,
                                   msg, &err))
                die("%s", err.buf);
@@ -269,7 +269,7 @@ static const char *parse_cmd_delete(struct ref_transaction *transaction,
                die("delete %s: extra input: %s", refname, next);
 
        if (ref_transaction_delete(transaction, refname,
-                                  have_old ? old_oid.hash : NULL,
+                                  have_old ? &old_oid : NULL,
                                   update_flags, msg, &err))
                die("%s", err.buf);
 
@@ -298,7 +298,7 @@ static const char *parse_cmd_verify(struct ref_transaction *transaction,
        if (*next != line_termination)
                die("verify %s: extra input: %s", refname, next);
 
-       if (ref_transaction_verify(transaction, refname, old_oid.hash,
+       if (ref_transaction_verify(transaction, refname, &old_oid,
                                   update_flags, &err))
                die("%s", err.buf);
 
@@ -434,10 +434,10 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
                 * NULL_SHA1 as "don't care" here:
                 */
                return delete_ref(msg, refname,
-                                 (oldval && !is_null_oid(&oldoid)) ? oldoid.hash : NULL,
+                                 (oldval && !is_null_oid(&oldoid)) ? &oldoid : NULL,
                                  flags);
        else
-               return update_ref(msg, refname, oid.hash, oldval ? oldoid.hash : NULL,
+               return update_ref(msg, refname, &oid, oldval ? &oldoid : NULL,
                                  flags | create_reflog_flag,
                                  UPDATE_REFS_DIE_ON_ERR);
 }