summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 05:04:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-30 05:04:07 (GMT)
commit50f08db5941755b69012378bfc86f6b8ee98edf4 (patch)
treed403a1dbf522fdaab4cf6b9b508a08b3965828e2 /submodule.c
parentbef896e4ab414312cdca493e0306d66ec7246b01 (diff)
parent746ea4adc6cd88ad5f5af6beebace581fe489b2f (diff)
downloadgit-50f08db5941755b69012378bfc86f6b8ee98edf4.zip
git-50f08db5941755b69012378bfc86f6b8ee98edf4.tar.gz
git-50f08db5941755b69012378bfc86f6b8ee98edf4.tar.bz2
Merge branch 'js/use-bug-macro'
Developer support update, by using BUG() macro instead of die() to mark codepaths that should not happen more clearly. * js/use-bug-macro: BUG_exit_code: fix sparse "symbol not declared" warning Convert remaining die*(BUG) messages Replace all die("BUG: ...") calls by BUG() ones run-command: use BUG() to report bugs, not die() test-tool: help verifying BUG() code paths
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/submodule.c b/submodule.c
index 8fd8e5d..eb08cf0 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1400,7 +1400,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')
@@ -1609,7 +1609,7 @@ int submodule_move_head(const char *path,
sub = submodule_from_path(the_repository, &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. */
@@ -1967,7 +1967,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);
@@ -2045,7 +2045,7 @@ const char *get_superproject_working_tree(void)
if (super_sub_len > cwd_len ||
strcmp(&cwd[cwd_len - super_sub_len], super_sub))
- die (_("BUG: returned path string doesn't match cwd?"));
+ BUG("returned path string doesn't match cwd?");
super_wt = xstrdup(cwd);
super_wt[cwd_len - super_sub_len] = '\0';