MCPcopy Create free account
hub / github.com/git/git / read_gitfile_error_die

Function read_gitfile_error_die

setup.c:920–944  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920void read_gitfile_error_die(int error_code, const char *path, const char *dir)
921{
922 switch (error_code) {
923 case READ_GITFILE_ERR_NOT_A_FILE:
924 case READ_GITFILE_ERR_STAT_FAILED:
925 case READ_GITFILE_ERR_MISSING:
926 case READ_GITFILE_ERR_IS_A_DIR:
927 /* non-fatal; follow return path */
928 break;
929 case READ_GITFILE_ERR_OPEN_FAILED:
930 die_errno(_("error opening '%s'"), path);
931 case READ_GITFILE_ERR_TOO_LARGE:
932 die(_("too large to be a .git file: '%s'"), path);
933 case READ_GITFILE_ERR_READ_FAILED:
934 die(_("error reading %s"), path);
935 case READ_GITFILE_ERR_INVALID_FORMAT:
936 die(_("invalid gitfile format: %s"), path);
937 case READ_GITFILE_ERR_NO_PATH:
938 die(_("no path in gitfile: %s"), path);
939 case READ_GITFILE_ERR_NOT_A_REPO:
940 die(_("not a git repository: %s"), dir);
941 default:
942 BUG("unknown error code");
943 }
944}
945
946/*
947 * Try to read the location of the git directory from the .git file,

Callers 3

read_gitfile_gentlyFunction · 0.85

Calls 2

die_errnoFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected