public class ClientVersionUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
compare(int[] a,
int[] b)
Compare two version strings for natural ordering.
|
static boolean |
hasChunkedEncodingRequestBug(int[] version,
javax.servlet.http.HttpServletRequest request)
Check if a Git client has the known chunked request body encoding bug.
|
static boolean |
hasPushStatusBug(int[] version)
Check if a Git client has the known push status bug.
|
static int[] |
invalidVersion()
An invalid version of Git
|
static int[] |
parseVersion(String version)
Parse a Git client User-Agent header value.
|
static String |
toString(int[] ver)
Convert a parsed version back to a string.
|
public static int[] invalidVersion()
public static int[] parseVersion(String version)
version
- git client version string, of the form "git/1.7.9".invalidVersion()
if
the version string cannot be parsed.public static int compare(int[] a, int[] b)
a
- first parsed version string.b
- second parsed version string.public static String toString(int[] ver)
ver
- the parsed version array.public static boolean hasPushStatusBug(int[] version)
These buggy clients do not display the status report from a failed push over HTTP.
version
- parsed version of the Git client software.public static boolean hasChunkedEncodingRequestBug(int[] version, javax.servlet.http.HttpServletRequest request)
Git 1.7.5 contains a unique bug where chunked requests are malformed. This applies to both fetch and push.
version
- parsed version of the Git client software.request
- incoming HTTP request.Copyright © 2020 Eclipse JGit Project. All rights reserved.