projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
svn import: Add direct HTTP access
[git.git]
/
upload-pack.c
diff --git
a/upload-pack.c
b/upload-pack.c
index
6d844cc
..
da10742
100644
(file)
--- a/
upload-pack.c
+++ b/
upload-pack.c
@@
-170,12
+170,16
@@
int main(int argc, char **argv)
if (argc != 2)
usage(upload_pack_usage);
dir = argv[1];
if (argc != 2)
usage(upload_pack_usage);
dir = argv[1];
- if (chdir(dir))
- die("git-upload-pack unable to chdir to %s", dir);
+
+ /* chdir to the directory. If that fails, try appending ".git" */
+ if (chdir(dir) < 0) {
+ if (chdir(mkpath("%s.git", dir)) < 0)
+ die("git-upload-pack unable to chdir to %s", dir);
+ }
chdir(".git");
if (access("objects", X_OK) || access("refs", X_OK))
die("git-upload-pack: %s doesn't seem to be a git archive", dir);
chdir(".git");
if (access("objects", X_OK) || access("refs", X_OK))
die("git-upload-pack: %s doesn't seem to be a git archive", dir);
-
setenv("GIT_DIR", ".", 1
);
+
putenv("GIT_DIR=."
);
upload_pack();
return 0;
}
upload_pack();
return 0;
}