aboutsummaryrefslogtreecommitdiffstats
path: root/stagit.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <[email protected]>2021-03-05 12:44:48 +0100
committerHiltjo Posthuma <[email protected]>2021-03-05 12:44:48 +0100
commit5ced189f1993fc17ae683f0a542218db7be7267b (patch)
treedad1d5c3ae6f47b6d97abbd1cb1befe7669b34a0 /stagit.c
parent7968c0bc9c0172bd654e1f87d8194aef7fb69865 (diff)
downloadstagit-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/stagit.c b/stagit.c
index 023ae55..5043c0d 100644
--- a/stagit.c
+++ b/stagit.c
@@ -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]);