summaryrefslogtreecommitdiff
path: root/submodule.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 /submodule.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 'submodule.c')
-rw-r--r--submodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/submodule.c b/submodule.c
index 9a50168..733db44 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1398,7 +1398,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
buf.buf[0] == '2') {
/* T = line type, XY = status, SSSS = submodule state */
if (buf.len < strlen("T XY SSSS"))
- die("BUG: invalid status --porcelain=2 line %s",
+ BUG("invalid status --porcelain=2 line %s",
buf.buf);
if (buf.buf[5] == 'S' && buf.buf[8] == 'U')
@@ -1607,7 +1607,7 @@ int submodule_move_head(const char *path,
sub = submodule_from_path(&null_oid, path);
if (!sub)
- die("BUG: could not get submodule information for '%s'", path);
+ BUG("could not get submodule information for '%s'", path);
if (old_head && !(flags & SUBMODULE_MOVE_HEAD_FORCE)) {
/* Check if the submodule has a dirty index. */
@@ -1965,7 +1965,7 @@ void absorb_git_dir_into_superproject(const char *prefix,
struct strbuf sb = STRBUF_INIT;
if (flags & ~ABSORB_GITDIR_RECURSE_SUBMODULES)
- die("BUG: we don't know how to pass the flags down?");
+ BUG("we don't know how to pass the flags down?");
strbuf_addstr(&sb, get_super_prefix_or_empty());
strbuf_addstr(&sb, path);