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
This commit is contained in:
@ -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';
|
||||
|
Reference in New Issue
Block a user