Merge branch 'mc/cred-helper-ignore-unknown'
Most credential helpers ignored unknown entries in a credential description, but a few died upon seeing them. The latter were taught to ignore them, too * mc/cred-helper-ignore-unknown: osxkeychain: clarify that we ignore unknown lines netrc: ignore unknown lines (do not die) wincred: ignore unknown lines (do not die)
This commit is contained in:
commit
dc6dd55f70
@ -356,7 +356,10 @@ sub read_credential_data_from_stdin {
|
||||
next unless m/^([^=]+)=(.+)/;
|
||||
|
||||
my ($token, $value) = ($1, $2);
|
||||
die "Unknown search token $token" unless exists $q{$token};
|
||||
|
||||
# skip any unknown tokens
|
||||
next unless exists $q{$token};
|
||||
|
||||
$q{$token} = $value;
|
||||
log_debug("We were given search token $token and value $value");
|
||||
}
|
||||
|
@ -159,6 +159,11 @@ static void read_credential(void)
|
||||
username = xstrdup(v);
|
||||
else if (!strcmp(buf, "password"))
|
||||
password = xstrdup(v);
|
||||
/*
|
||||
* Ignore other lines; we don't know what they mean, but
|
||||
* this future-proofs us when later versions of git do
|
||||
* learn new lines, and the helpers are updated to match.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,8 +278,11 @@ static void read_credential(void)
|
||||
wusername = utf8_to_utf16_dup(v);
|
||||
} else if (!strcmp(buf, "password"))
|
||||
password = utf8_to_utf16_dup(v);
|
||||
else
|
||||
die("unrecognized input");
|
||||
/*
|
||||
* Ignore other lines; we don't know what they mean, but
|
||||
* this future-proofs us when later versions of git do
|
||||
* learn new lines, and the helpers are updated to match.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user