int read_stdin = 1;
int inaccurate_eof = 0;
int errs = 0;
- int is_not_gitdir = 0;
+ int is_not_gitdir;
const char *whitespace_option = NULL;
int cmd_bundle(int argc, const char **argv, const char *prefix)
{
struct bundle_header header;
- int nongit = 0;
+ int nongit;
const char *cmd, *bundle_file;
int bundle_fd = -1;
char buffer[PATH_MAX];
int cmd_config(int argc, const char **argv, const char *prefix)
{
- int nongit = 0;
+ int nongit;
char* value;
const char *file = setup_git_directory_gently(&nongit);
int cmd_diff_files(int argc, const char **argv, const char *prefix)
{
struct rev_info rev;
- int nongit = 0;
+ int nongit;
int result;
prefix = setup_git_directory_gently(&nongit);
int ents = 0, blobs = 0, paths = 0;
const char *path = NULL;
struct blobinfo blob[2];
- int nongit = 0;
+ int nongit;
int result = 0;
/*
{
int i;
const char *dest = NULL;
- int nongit = 0;
+ int nongit;
unsigned flags = 0;
const char *uploadpack = NULL;
const char **pattern = NULL;
static int handle_alias(int *argcp, const char ***argv)
{
- int nongit = 0, envchanged = 0, ret = 0, saved_errno = errno;
+ int envchanged = 0, ret = 0, saved_errno = errno;
const char *subdir;
int count, option_count;
const char** new_argv;
const char *alias_command;
char *alias_string;
- subdir = setup_git_directory_gently(&nongit);
+ subdir = setup_git_directory_gently(NULL);
alias_command = (*argv)[0];
alias_string = alias_lookup(alias_command);
const char *gitdirenv;
int len, offset;
+ /*
+ * Let's assume that we are in a git repository.
+ * If it turns out later that we are somewhere else, the value will be
+ * updated accordingly.
+ */
+ if (nongit_ok)
+ *nongit_ok = 0;
+
/*
* If GIT_DIR is set explicitly, we're not going
* to do any discovery, but we still do repository