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>
This commit is contained in:
Junio C Hamano
2005-09-15 14:56:37 -07:00
parent 0de68d28d3
commit f71a69ab05
7 changed files with 46 additions and 6 deletions

View File

@ -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];