summaryrefslogtreecommitdiff
path: root/ssh-fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-15 21:56:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-15 21:56:37 (GMT)
commitf71a69ab055c47056d0270b29b8f7455278c2422 (patch)
tree783a7ee17c193bb5baa6f8ebb87e6ce365ae13e6 /ssh-fetch.c
parent0de68d28d34f915951324b9f387e6e67172e9951 (diff)
downloadgit-f71a69ab055c47056d0270b29b8f7455278c2422.zip
git-f71a69ab055c47056d0270b29b8f7455278c2422.tar.gz
git-f71a69ab055c47056d0270b29b8f7455278c2422.tar.bz2
Be more backward compatible with git-ssh-{push,pull}.
HPA reminded me that these programs knows about the name of the counterpart on the other end and simply symlinking the old name to new name locally would not be enough. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ssh-fetch.c')
-rw-r--r--ssh-fetch.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ssh-fetch.c b/ssh-fetch.c
index d8f4368..683a1e4 100644
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
@@ -1,3 +1,13 @@
+#ifndef COUNTERPART_ENV_NAME
+#define COUNTERPART_ENV_NAME "GIT_SSH_UPLOAD"
+#endif
+#ifndef COUNTERPART_PROGRAM_NAME
+#define COUNTERPART_PROGRAM_NAME "git-ssh-upload"
+#endif
+#ifndef MY_PROGRAM_NAME
+#define MY_PROGRAM_NAME "git-ssh-fetch"
+#endif
+
#include "cache.h"
#include "commit.h"
#include "rsh.h"
@@ -82,6 +92,9 @@ int fetch_ref(char *ref, unsigned char *sha1)
return 0;
}
+static const char ssh_fetch_usage[] =
+ MY_PROGRAM_NAME
+ " [-c] [-t] [-a] [-v] [-d] [--recover] [-w ref] commit-id url";
int main(int argc, char **argv)
{
char *commit_id;
@@ -110,7 +123,7 @@ int main(int argc, char **argv)
arg++;
}
if (argc < arg + 2) {
- usage("git-ssh-fetch [-c] [-t] [-a] [-v] [-d] [--recover] [-w ref] commit-id url");
+ usage(ssh_fetch_usage);
return 1;
}
commit_id = argv[arg];