diff options
author | Hiltjo Posthuma <[email protected]> | 2021-03-05 12:44:48 +0100 |
---|---|---|
committer | Hiltjo Posthuma <[email protected]> | 2021-03-05 12:44:48 +0100 |
commit | 5ced189f1993fc17ae683f0a542218db7be7267b (patch) | |
tree | dad1d5c3ae6f47b6d97abbd1cb1befe7669b34a0 /stagit.c | |
parent | 7968c0bc9c0172bd654e1f87d8194aef7fb69865 (diff) | |
download | stagit-5ced189f1993fc17ae683f0a542218db7be7267b.tar.gz stagit-5ced189f1993fc17ae683f0a542218db7be7267b.zip |
change STAGIT_BASEURL to an -u option and also update the example script
Diffstat (limited to 'stagit.c')
-rw-r--r-- | stagit.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1125,7 +1125,8 @@ writerefs(FILE *fp) void usage(char *argv0) { - fprintf(stderr, "%s [-c cachefile | -l commits] repodir\n", argv0); + fprintf(stderr, "%s [-c cachefile | -l commits] " + "[-u baseurl] repodir\n", argv0); exit(1); } @@ -1158,6 +1159,10 @@ main(int argc, char *argv[]) if (argv[i][0] == '\0' || *p != '\0' || nlogcommits <= 0 || errno) usage(argv[0]); + } else if (argv[i][1] == 'u') { + if (i + 1 >= argc) + usage(argv[0]); + baseurl = argv[++i]; } } if (!repodir) @@ -1185,9 +1190,6 @@ main(int argc, char *argv[]) } #endif - if ((p = getenv("STAGIT_BASEURL"))) - baseurl = p; - if (git_repository_open_ext(&repo, repodir, GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) { fprintf(stderr, "%s: cannot open repository\n", argv[0]); |