From 1b66f2c5740504931c78f499a378ba70f18b962c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E6=97=A0=E5=BF=83?= <448901948@qq.com> Date: Tue, 29 Oct 2019 15:45:29 +0800 Subject: [PATCH] Update Trees.php If the sha is null then the file will be deleted. --- lib/Github/Api/GitData/Trees.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Github/Api/GitData/Trees.php b/lib/Github/Api/GitData/Trees.php index d514d9f8205..939e8619b73 100644 --- a/lib/Github/Api/GitData/Trees.php +++ b/lib/Github/Api/GitData/Trees.php @@ -54,7 +54,7 @@ public function create($username, $repository, array $params) } // If `sha` is not set, `content` is required - if (!isset($tree['sha']) && !isset($tree['content'])) { + if (!array_key_exists('sha', $tree) && !isset($tree['content'])) { throw new MissingArgumentException("tree.$key.content"); } }