summaryrefslogtreecommitdiff
path: root/sha1-name.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-05-02 09:38:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-06 10:06:13 (GMT)
commit033abf97fcbc247eabf915780181d947cfb66205 (patch)
tree3bc9fcff58ff630c3d94fbd5535f29948b2b0ef0 /sha1-name.c
parentdde74d732fc3c5fa4bc4238aa935c164ff6c2dd5 (diff)
downloadgit-033abf97fcbc247eabf915780181d947cfb66205.zip
git-033abf97fcbc247eabf915780181d947cfb66205.tar.gz
git-033abf97fcbc247eabf915780181d947cfb66205.tar.bz2
Replace all die("BUG: ...") calls by BUG() ones
In d8193743e08 (usage.c: add BUG() function, 2017-05-12), a new macro was introduced to use for reporting bugs instead of die(). It was then subsequently used to convert one single caller in 588a538ae55 (setup_git_env: convert die("BUG") to BUG(), 2017-05-12). The cover letter of the patch series containing this patch (cf 20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net) is not terribly clear why only one call site was converted, or what the plan is for other, similar calls to die() to report bugs. Let's just convert all remaining ones in one fell swoop. This trick was performed by this invocation: sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-name.c')
-rw-r--r--sha1-name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1-name.c b/sha1-name.c
index 5b93bf8..60d04bf 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -384,7 +384,7 @@ static int get_short_oid(const char *name, int len, struct object_id *oid,
return -1;
if (HAS_MULTI_BITS(flags & GET_OID_DISAMBIGUATORS))
- die("BUG: multiple get_short_oid disambiguator flags");
+ BUG("multiple get_short_oid disambiguator flags");
if (flags & GET_OID_COMMIT)
ds.fn = disambiguate_commit_only;
@@ -1729,6 +1729,6 @@ void maybe_die_on_misspelt_object_name(const char *name, const char *prefix)
int get_oid_with_context(const char *str, unsigned flags, struct object_id *oid, struct object_context *oc)
{
if (flags & GET_OID_FOLLOW_SYMLINKS && flags & GET_OID_ONLY_TO_DIE)
- die("BUG: incompatible flags for get_sha1_with_context");
+ BUG("incompatible flags for get_sha1_with_context");
return get_oid_with_context_1(str, flags, NULL, oid, oc);
}