projects
/
platform
/
upstream
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.29.0
[platform/upstream/git.git]
/
http-fetch.c
diff --git
a/http-fetch.c
b/http-fetch.c
index
1df376e
..
c4ccc5f
100644
(file)
--- a/
http-fetch.c
+++ b/
http-fetch.c
@@
-84,8
+84,11
@@
int cmd_main(int argc, const char **argv)
int get_verbosely = 0;
int get_recover = 0;
int packfile = 0;
int get_verbosely = 0;
int get_recover = 0;
int packfile = 0;
+ int nongit;
struct object_id packfile_hash;
struct object_id packfile_hash;
+ setup_git_directory_gently(&nongit);
+
while (arg < argc && argv[arg][0] == '-') {
const char *p;
while (arg < argc && argv[arg][0] == '-') {
const char *p;
@@
-115,7
+118,8
@@
int cmd_main(int argc, const char **argv)
if (argc != arg + 2 - (commits_on_stdin || packfile))
usage(http_fetch_usage);
if (argc != arg + 2 - (commits_on_stdin || packfile))
usage(http_fetch_usage);
- setup_git_directory();
+ if (nongit)
+ die(_("not a git repository"));
git_config(git_default_config, NULL);
git_config(git_default_config, NULL);