summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-07-18 12:04:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-18 20:26:53 (GMT)
commit6319a2a148adaa78f11414e914f8c9f3f1c52b5e (patch)
treea223fb037abb7b810227eb5efd70550a0f06765a /contrib/mw-to-git
parent3e5f29e8963a9a6f1774add194ec19583c19fbb6 (diff)
downloadgit-6319a2a148adaa78f11414e914f8c9f3f1c52b5e.zip
git-6319a2a148adaa78f11414e914f8c9f3f1c52b5e.tar.gz
git-6319a2a148adaa78f11414e914f8c9f3f1c52b5e.tar.bz2
mw-to-git: check blank credential attributes via length
When writing a credential to git-credential, we omit fields that do not have a true value. This will skip empty or undefined fields (which we want), but will also accidentally skip usernames or passwords which happen to have a non-true value (e.g., "0"). Be more careful by checking for non-zero length. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git')
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index accd70a..b06f27b 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -207,7 +207,7 @@ sub credential_write {
my $credential = shift;
my $writer = shift;
while (my ($key, $value) = each(%$credential) ) {
- if ($value) {
+ if (length $value) {
print $writer "$key=$value\n";
}
}