944
/* OK */
945
break;
946
case REF_TRANSACTION_PREPARED:
947
- die("BUG: free called on a prepared reference transaction");
947
+ BUG("free called on a prepared reference transaction");
948
break;
949
default:
950
- die("BUG: unexpected reference transaction state");
950
+ BUG("unexpected reference transaction state");
951
break;
952
}
953
969
struct ref_update *update;
970
971
if (transaction->state != REF_TRANSACTION_OPEN)
972
- die("BUG: update called for transaction that is not open");
972
+ BUG("update called for transaction that is not open");
973
974
FLEX_ALLOC_STR(update, refname, refname);
975
ALLOC_GROW(transaction->updates, transaction->nr + 1, transaction->alloc);
1019
struct strbuf *err)
1020
{
1021
if (!new_oid || is_null_oid(new_oid))
1022
- die("BUG: create called without valid new_oid");
1022
+ BUG("create called without valid new_oid");
1023
return ref_transaction_update(transaction, refname, new_oid,
1024
&null_oid, flags, msg, err);
1025
}
1031
struct strbuf *err)
1032
{
1033
if (old_oid && is_null_oid(old_oid))
1034
- die("BUG: delete called with old_oid set to zeros");
1034
+ BUG("delete called with old_oid set to zeros");
1035
return ref_transaction_update(transaction, refname,
1036
&null_oid, old_oid,
1037
flags, msg, err);
1044
struct strbuf *err)
1045
{
1046
if (!old_oid)
1047
- die("BUG: verify called with old_oid set to NULL");
1047
+ BUG("verify called with old_oid set to NULL");
1048
return ref_transaction_update(transaction, refname,
1049
NULL, old_oid,
1050
flags, NULL, err);
1645
struct ref_store *refs;
1646
1647
if (!be)
1648
- die("BUG: reference backend %s is unknown", be_name);
1648
+ BUG("reference backend %s is unknown", be_name);
1649
1650
refs = be->init(gitdir, flags);
1651
return refs;
1673
hashmap_init(map, ref_store_hash_cmp, NULL, 0);
1674
1675
if (hashmap_put(map, alloc_ref_store_hash_entry(name, refs)))
1676
- die("BUG: %s ref_store '%s' initialized twice", type, name);
1676
+ BUG("%s ref_store '%s' initialized twice", type, name);
1677
}
1678
1679
struct ref_store *get_submodule_ref_store(const char *submodule)
1819
refnames->items[i].string);
1820
return 1;
1821
} else if (cmp > 0) {
1822
- die("BUG: ref_update_reject_duplicates() received unsorted list");
1822
+ BUG("ref_update_reject_duplicates() received unsorted list");
1823
}
1824
}
1825
return 0;
1835
/* Good. */
1836
break;
1837
case REF_TRANSACTION_PREPARED:
1838
- die("BUG: prepare called twice on reference transaction");
1838
+ BUG("prepare called twice on reference transaction");
1839
break;
1840
case REF_TRANSACTION_CLOSED:
1841
- die("BUG: prepare called on a closed reference transaction");
1841
+ BUG("prepare called on a closed reference transaction");
1842
break;
1843
default:
1844
- die("BUG: unexpected reference transaction state");
1844
+ BUG("unexpected reference transaction state");
1845
break;
1846
}
1847
1868
ret = refs->be->transaction_abort(refs, transaction, err);
1869
break;
1870
case REF_TRANSACTION_CLOSED:
1871
- die("BUG: abort called on a closed reference transaction");
1871
+ BUG("abort called on a closed reference transaction");
1872
break;
1873
default:
1874
- die("BUG: unexpected reference transaction state");
1874
+ BUG("unexpected reference transaction state");
1875
break;
1876
}
1877
1896
/* Fall through to finish. */
1897
break;
1898
case REF_TRANSACTION_CLOSED:
1899
- die("BUG: commit called on a closed reference transaction");
1899
+ BUG("commit called on a closed reference transaction");
1900
break;
1901
default:
1902
- die("BUG: unexpected reference transaction state");
1902
+ BUG("unexpected reference transaction state");
1903
break;
1904
}
1905
1980
}
1981
1982
if (ok != ITER_DONE)
1983
- die("BUG: error while iterating over references");
1983
+ BUG("error while iterating over references");
1984
1985
extra_refname = find_descendant_ref(dirname.buf, extras, skip);
1986
if (extra_refname)