You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http-push: convert some static functions to struct object_id
Among the functions converted is a caller of lookup_commit_or_die, which
we will convert later on.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
@@ -1579,7 +1579,7 @@ static int delete_remote_branch(const char *pattern, int force)
1579
1579
{
1580
1580
structref*refs=remote_refs;
1581
1581
structref*remote_ref=NULL;
1582
-
unsigned charhead_sha1[20];
1582
+
structobject_idhead_oid;
1583
1583
char*symref=NULL;
1584
1584
intmatch;
1585
1585
intpatlen=strlen(pattern);
@@ -1610,7 +1610,7 @@ static int delete_remote_branch(const char *pattern, int force)
1610
1610
* Remote HEAD must be a symref (not exactly foolproof; a remote
1611
1611
* symlink to a symref will look like a symref)
1612
1612
*/
1613
-
fetch_symref("HEAD", &symref, head_sha1);
1613
+
fetch_symref("HEAD", &symref, &head_oid);
1614
1614
if (!symref)
1615
1615
returnerror("Remote HEAD is not a symref");
1616
1616
@@ -1619,18 +1619,18 @@ static int delete_remote_branch(const char *pattern, int force)
1619
1619
if (!strcmp(remote_ref->name, symref))
1620
1620
returnerror("Remote branch %s is the current HEAD",
1621
1621
remote_ref->name);
1622
-
fetch_symref(symref, &symref, head_sha1);
1622
+
fetch_symref(symref, &symref, &head_oid);
1623
1623
}
1624
1624
1625
1625
/* Run extra sanity checks if delete is not forced */
1626
1626
if (!force) {
1627
1627
/* Remote HEAD must resolve to a known object */
1628
1628
if (symref)
1629
1629
returnerror("Remote HEAD symrefs too deep");
1630
-
if (is_null_sha1(head_sha1))
1630
+
if (is_null_oid(&head_oid))
1631
1631
returnerror("Unable to resolve remote HEAD");
1632
-
if (!has_sha1_file(head_sha1))
1633
-
returnerror("Remote HEAD resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", sha1_to_hex(head_sha1));
1632
+
if (!has_object_file(&head_oid))
1633
+
returnerror("Remote HEAD resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", oid_to_hex(&head_oid));
1634
1634
1635
1635
/* Remote branch must resolve to a known object */
1636
1636
if (is_null_oid(&remote_ref->old_oid))
@@ -1640,7 +1640,7 @@ static int delete_remote_branch(const char *pattern, int force)
1640
1640
returnerror("Remote branch %s resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", remote_ref->name, oid_to_hex(&remote_ref->old_oid));
1641
1641
1642
1642
/* Remote branch must be an ancestor of remote HEAD */
0 commit comments