1 diff -u -r ../git-2.9.0/config.c ./config.c
2 --- ../git-2.9.0/config.c 2016-06-13 15:07:49.000000000 -0400
3 +++ ./config.c 2016-06-19 20:16:44.473791157 -0400
6 static struct config_set the_config_set;
9 + * Protecting the project-specific git configuration file (.git/config) is
10 + * not possible on a shared file system on Android, which on an unpatched
11 + * git causes operations such as clone to fail with an error message.
13 + * For the Termux git package we introduce a warning about the configuration
14 + * file being unprotected, but proceed in order to allow git repositories
15 + * to be cloned to shared storage accessible to other apps.
17 +static void termux_warn_once_about_lockfile()
19 + static int already_warned;
20 + if (!already_warned) {
21 + warning("Cannot protect .git/config on this file system"
22 + " - do not store sensitive information here.");
27 static int config_file_fgetc(struct config_source *conf)
29 return getc_unlocked(conf->u.file);
30 @@ -2123,9 +2142,13 @@
33 if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) {
35 + termux_warn_once_about_lockfile();
37 error_errno("chmod on %s failed", get_lock_file_path(lock));
38 ret = CONFIG_NO_WRITE;
44 @@ -2330,9 +2353,13 @@
45 fstat(fileno(config_file), &st);
47 if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) {
49 + termux_warn_once_about_lockfile();
51 ret = error_errno("chmod on %s failed",
52 get_lock_file_path(lock));
57 while (fgets(buf, sizeof(buf), config_file)) {