Commit e172ba2ea2f0115772dfd3cde60b7246f61b8756

Stefan Sperling 2020-03-19T17:07:22

appending [remote "origin"] section is enough; no need to overwrite the file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/got/got.c b/got/got.c
index 03cc163..42d8788 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1096,15 +1096,12 @@ cmd_clone(int argc, char *argv[])
 		error = got_error_from_errno("got_repo_get_path_gitconfig");
 		goto done;
 	}
-	gitconfig_file = fopen(gitconfig_path, "w");
+	gitconfig_file = fopen(gitconfig_path, "a");
 	if (gitconfig_file == NULL) {
 		error = got_error_from_errno2("fopen", gitconfig_path);
 		goto done;
 	}
 	if (asprintf(&gitconfig,
-	    "[core]\n"
-	    "\trepositoryformatversion = 0\n"
-	    "\tbare = true\n"
 	    "[remote \"%s\"]\n"
 	    "\turl = %s\n"
 	    "\tfetch = +refs/heads/*:refs/remotes/%s/*\n",