Download raw body.
make it possible to ignore Git config file
Omar found a test failure in test_rebase_no_author_info(), where the
author from ~/.gitconfig will be used instead of having no author set.
This patch adds a switch we can use to ignore Git configuration settings.
Git's config file contains some data we must not ignore, such as the
repository format version (smart idea to store this in the user-facing
config file, isn't it), and any enabled repository format extensions
(if any of them are enabled then we must not touch the repository).
Once this is in, we can fix test_rebase_no_author_info() by setting
this variable. It might also be useful in other situations, so I decided
to document it instead of making it a hidden setting.
ok?
diff /home/stsp/src/got
commit - 2c8899b952f67f90ab3a26b4331491832fe93c8a
path + /home/stsp/src/got
blob - ea412540fd202511367fedfbeaa5f864e0051758
file + got/got.1
--- got/got.1
+++ got/got.1
@@ -2750,7 +2750,7 @@ argument corresponds to the work tree's root directory
for all tracked files.
.El
.Sh ENVIRONMENT
-.Bl -tag -width GOT_AUTHOR
+.Bl -tag -width GOT_IGNORE_GITCONFIG
.It Ev GOT_AUTHOR
The author's name and email address, such as
.Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
@@ -2806,6 +2806,9 @@ The default limit on the number of commits traversed b
.Cm got log .
If set to zero, the limit is unbounded.
This variable will be silently ignored if it is set to a non-numeric value.
+.It Ev GOT_IGNORE_GITCONFIG
+If this variable is set then any remote repository definitions or author
+information found in Git configuration files will be ignored.
.El
.Sh FILES
.Bl -tag -width packed-refs -compact
blob - c16937331653c5414c3a3ed0215a2b9f3193f106
file + lib/repository.c
--- lib/repository.c
+++ lib/repository.c
@@ -678,6 +678,23 @@ read_gitconfig(struct got_repository *repo, const char
repo_gitconfig_path);
if (err)
goto done;
+
+ if (getenv("GOT_IGNORE_GITCONFIG") != NULL) {
+ int i;
+
+ for (i = 0; i < repo->ngitconfig_remotes; i++) {
+ got_repo_free_remote_repo_data(
+ &repo->gitconfig_remotes[i]);
+ }
+ free(repo->gitconfig_remotes);
+ repo->ngitconfig_remotes = 0;
+
+ free(repo->gitconfig_author_name);
+ repo->gitconfig_author_name = NULL;
+ free(repo->gitconfig_author_email);
+ repo->gitconfig_author_email = NULL;
+ }
+
done:
free(repo_gitconfig_path);
return err;
make it possible to ignore Git config file