config: preserve config file permissions on edits
commitdaa22c6f8da466bd7a438f1bc27375fd737ffcf3
authorEric Wong <normalperson@yhbt.net>
Tue, 6 May 2014 00:17:14 +0000 (6 00:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 May 2014 19:23:58 +0000 (6 12:23 -0700)
treedc6e1dcb229c908bdd71bbfed713fb6e06b4df17
parent0bc85abb7aa9b24b093253018801a0fb43d01122
config: preserve config file permissions on edits

Users may already store sensitive data such as imap.pass in
.git/config; making the file world-readable when "git config"
is called to edit means their password would be compromised
on a shared system.

[v2: updated for section renames, as noted by Junio]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
t/t1300-repo-config.sh