projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Add -k kill keyword expansion option to git-cvsimport - revised
[git.git]
/
upload-pack.c
diff --git
a/upload-pack.c
b/upload-pack.c
index
d35c068
..
95d3812
100644
(file)
--- a/
upload-pack.c
+++ b/
upload-pack.c
@@
-5,7
+5,7
@@
static const char upload_pack_usage[] = "git-upload-pack <dir>";
#define MAX_HAS (16)
static const char upload_pack_usage[] = "git-upload-pack <dir>";
#define MAX_HAS (16)
-#define MAX_NEEDS (
1
6)
+#define MAX_NEEDS (
25
6)
static int nr_has = 0, nr_needs = 0;
static unsigned char has_sha1[MAX_HAS][20];
static unsigned char needs_sha1[MAX_NEEDS][20];
static int nr_has = 0, nr_needs = 0;
static unsigned char has_sha1[MAX_HAS][20];
static unsigned char needs_sha1[MAX_NEEDS][20];
@@
-153,6
+153,7
@@
static int send_ref(const char *refname, const unsigned char *sha1)
static int upload_pack(void)
{
static int upload_pack(void)
{
+ head_ref(send_ref);
for_each_ref(send_ref);
packet_flush(1);
nr_needs = receive_needs();
for_each_ref(send_ref);
packet_flush(1);
nr_needs = receive_needs();
@@
-169,8
+170,12
@@
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);