From e4a6f313b105751743828686cb0cce1a322b0a4e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Sat, 3 Nov 2012 12:59:48 +0800 Subject: [PATCH] MTrack/SCM/Git/Repo.php --- MTrack/SCM/Git/Repo.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MTrack/SCM/Git/Repo.php b/MTrack/SCM/Git/Repo.php index 196d9850..e9760bab 100644 --- a/MTrack/SCM/Git/Repo.php +++ b/MTrack/SCM/Git/Repo.php @@ -216,6 +216,9 @@ HOOK; * * @param string path (can be empty - eg. '') * @param {number|date} limit how many to fetch + * + * -- prefered args: + * * @param {string} object = eg. rev|tag|branch (use 'rev' here and ident=HASH to retrieve a speific revision * @param {string} ident = * @@ -244,10 +247,16 @@ HOOK; if ($limit !== null) { if (is_int($limit)) { $args[] = "--max-count=$limit"; - } else if (is_array($limit)) { + } else if (is_array($limit) && isset($limit[0]) && isset($limit[2])) { + $args[] = "--skip={$limit[0]} --max-count={$limit[1]}"; + } else if (is_array($limit) ) { + foreach($line as $k=>$v) { + $args[] = ($k = '-' ? '' : ('--'. $k .'='. $v; + } $args[] = "--skip={$limit[0]} --max-count={$limit[1]}"; } else { + $args[] = "--since=$limit"; } } -- 2.39.2