We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
InputGitTreeElement should allow passing "null" for sha
Github's [Tree creation api](https://developer.github.com/v3/git/trees/#create-a-tree) allows us to pass `sha = null` to indicate that the specified blob needs to be deleted.

However, I don't have a way to pass this info to my `InputGitTreeElement`. I can either give it a str or a `github.GithubObject.NotSet`. This means I have no way of deleting files from a tree using PyGithub (I'd like to delete multiple files in a single commit so tree creation is the ideal choice for me).

The current design is to only pass the `sha` if it is actually set:
https://github.com/PyGithub/PyGithub/blob/540a085001/github/InputGitTreeElement.py#L81

I can understand that passing a `None` goes against the design. I think something like `github.GithubObject.Null` could be introduced to explicitly say that this field is `null`. It can be used everywhere the GH API accepts a null value.

Example
```python
new_tree = repo.create_git_tree(
    [
        InputGitTreeElement(
            path="my/dir/my_file.txt", mode="100644", type="blob", sha=github.GithubObject.Null
        ),
   ],
    base_tree=head_commit.tree
)
```
This will delete `my/dir/my_file.txt`

---

My current workaround is to directly hit the api to create tree (using requests, setting `sha=None`), get the tree sha & use it with pygithub for my remaining workflow (committing, etc).

Please let me know in case I misunderstood some aspect or if anything needs to be elaborated upon.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `github/InputGitTreeElement.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 ############################ Copyrights and license ############################
4 #                                                                              #
5 # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #
6 # Copyright 2012 Zearin <zearin@gonk.net>                                      #
7 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #
8 # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #
9 # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
10 # Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #
11 # Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
12 #                                                                              #
13 # This file is part of PyGithub.                                               #
14 # http://pygithub.readthedocs.io/                                              #
15 #                                                                              #
16 # PyGithub is free software: you can redistribute it and/or modify it under    #
17 # the terms of the GNU Lesser General Public License as published by the Free  #
18 # Software Foundation, either version 3 of the License, or (at your option)    #
19 # any later version.                                                           #
20 #                                                                              #
21 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
22 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
23 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
24 # details.                                                                     #
25 #                                                                              #
26 # You should have received a copy of the GNU Lesser General Public License     #
27 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
28 #                                                                              #
29 ################################################################################
30 
31 from __future__ import absolute_import
32 
33 import six
34 
35 import github.GithubObject
36 
37 
38 class InputGitTreeElement(object):
39     """
40     This class represents InputGitTreeElements
41     """
42 
43     def __init__(
44         self,
45         path,
46         mode,
47         type,
48         content=github.GithubObject.NotSet,
49         sha=github.GithubObject.NotSet,
50     ):
51         """
52         :param path: string
53         :param mode: string
54         :param type: string
55         :param content: string
56         :param sha: string
57         """
58 
59         assert isinstance(path, (str, six.text_type)), path
60         assert isinstance(mode, (str, six.text_type)), mode
61         assert isinstance(type, (str, six.text_type)), type
62         assert content is github.GithubObject.NotSet or isinstance(
63             content, (str, six.text_type)
64         ), content
65         assert sha is github.GithubObject.NotSet or isinstance(
66             sha, (str, six.text_type)
67         ), sha
68         self.__path = path
69         self.__mode = mode
70         self.__type = type
71         self.__content = content
72         self.__sha = sha
73 
74     @property
75     def _identity(self):
76         identity = {
77             "path": self.__path,
78             "mode": self.__mode,
79             "type": self.__type,
80         }
81         if self.__sha is not github.GithubObject.NotSet:
82             identity["sha"] = self.__sha
83         if self.__content is not github.GithubObject.NotSet:
84             identity["content"] = self.__content
85         return identity
86
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py
--- a/github/InputGitTreeElement.py
+++ b/github/InputGitTreeElement.py
@@ -53,7 +53,7 @@
         :param mode: string
         :param type: string
         :param content: string
-        :param sha: string
+        :param sha: string or None
         """
 
         assert isinstance(path, (str, six.text_type)), path
@@ -62,8 +62,10 @@
         assert content is github.GithubObject.NotSet or isinstance(
             content, (str, six.text_type)
         ), content
-        assert sha is github.GithubObject.NotSet or isinstance(
-            sha, (str, six.text_type)
+        assert (
+            sha is github.GithubObject.NotSet
+            or sha is None
+            or isinstance(sha, (str, six.text_type))
         ), sha
         self.__path = path
         self.__mode = mode

{"golden_diff": "diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py\n--- a/github/InputGitTreeElement.py\n+++ b/github/InputGitTreeElement.py\n@@ -53,7 +53,7 @@\n         :param mode: string\n         :param type: string\n         :param content: string\n-        :param sha: string\n+        :param sha: string or None\n         \"\"\"\n \n         assert isinstance(path, (str, six.text_type)), path\n@@ -62,8 +62,10 @@\n         assert content is github.GithubObject.NotSet or isinstance(\n             content, (str, six.text_type)\n         ), content\n-        assert sha is github.GithubObject.NotSet or isinstance(\n-            sha, (str, six.text_type)\n+        assert (\n+            sha is github.GithubObject.NotSet\n+            or sha is None\n+            or isinstance(sha, (str, six.text_type))\n         ), sha\n         self.__path = path\n         self.__mode = mode\n", "issue": "InputGitTreeElement should allow passing \"null\" for sha\nGithub's [Tree creation api](https://developer.github.com/v3/git/trees/#create-a-tree) allows us to pass `sha = null` to indicate that the specified blob needs to be deleted.\r\n\r\nHowever, I don't have a way to pass this info to my `InputGitTreeElement`. I can either give it a str or a `github.GithubObject.NotSet`. This means I have no way of deleting files from a tree using PyGithub (I'd like to delete multiple files in a single commit so tree creation is the ideal choice for me).\r\n\r\nThe current design is to only pass the `sha` if it is actually set:\r\nhttps://github.com/PyGithub/PyGithub/blob/540a085001/github/InputGitTreeElement.py#L81\r\n\r\nI can understand that passing a `None` goes against the design. I think something like `github.GithubObject.Null` could be introduced to explicitly say that this field is `null`. It can be used everywhere the GH API accepts a null value.\r\n\r\nExample\r\n```python\r\nnew_tree = repo.create_git_tree(\r\n    [\r\n        InputGitTreeElement(\r\n            path=\"my/dir/my_file.txt\", mode=\"100644\", type=\"blob\", sha=github.GithubObject.Null\r\n        ),\r\n   ],\r\n    base_tree=head_commit.tree\r\n)\r\n```\r\nThis will delete `my/dir/my_file.txt`\r\n\r\n---\r\n\r\nMy current workaround is to directly hit the api to create tree (using requests, setting `sha=None`), get the tree sha & use it with pygithub for my remaining workflow (committing, etc).\r\n\r\nPlease let me know in case I misunderstood some aspect or if anything needs to be elaborated upon.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2012 Zearin <zearin@gonk.net>                                      #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nfrom __future__ import absolute_import\n\nimport six\n\nimport github.GithubObject\n\n\nclass InputGitTreeElement(object):\n    \"\"\"\n    This class represents InputGitTreeElements\n    \"\"\"\n\n    def __init__(\n        self,\n        path,\n        mode,\n        type,\n        content=github.GithubObject.NotSet,\n        sha=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :param path: string\n        :param mode: string\n        :param type: string\n        :param content: string\n        :param sha: string\n        \"\"\"\n\n        assert isinstance(path, (str, six.text_type)), path\n        assert isinstance(mode, (str, six.text_type)), mode\n        assert isinstance(type, (str, six.text_type)), type\n        assert content is github.GithubObject.NotSet or isinstance(\n            content, (str, six.text_type)\n        ), content\n        assert sha is github.GithubObject.NotSet or isinstance(\n            sha, (str, six.text_type)\n        ), sha\n        self.__path = path\n        self.__mode = mode\n        self.__type = type\n        self.__content = content\n        self.__sha = sha\n\n    @property\n    def _identity(self):\n        identity = {\n            \"path\": self.__path,\n            \"mode\": self.__mode,\n            \"type\": self.__type,\n        }\n        if self.__sha is not github.GithubObject.NotSet:\n            identity[\"sha\"] = self.__sha\n        if self.__content is not github.GithubObject.NotSet:\n            identity[\"content\"] = self.__content\n        return identity\n", "path": "github/InputGitTreeElement.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n############################ Copyrights and license ############################\n#                                                                              #\n# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2012 Zearin <zearin@gonk.net>                                      #\n# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #\n# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #\n# Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #\n# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #\n#                                                                              #\n# This file is part of PyGithub.                                               #\n# http://pygithub.readthedocs.io/                                              #\n#                                                                              #\n# PyGithub is free software: you can redistribute it and/or modify it under    #\n# the terms of the GNU Lesser General Public License as published by the Free  #\n# Software Foundation, either version 3 of the License, or (at your option)    #\n# any later version.                                                           #\n#                                                                              #\n# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #\n# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #\n# details.                                                                     #\n#                                                                              #\n# You should have received a copy of the GNU Lesser General Public License     #\n# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #\n#                                                                              #\n################################################################################\n\nfrom __future__ import absolute_import\n\nimport six\n\nimport github.GithubObject\n\n\nclass InputGitTreeElement(object):\n    \"\"\"\n    This class represents InputGitTreeElements\n    \"\"\"\n\n    def __init__(\n        self,\n        path,\n        mode,\n        type,\n        content=github.GithubObject.NotSet,\n        sha=github.GithubObject.NotSet,\n    ):\n        \"\"\"\n        :param path: string\n        :param mode: string\n        :param type: string\n        :param content: string\n        :param sha: string or None\n        \"\"\"\n\n        assert isinstance(path, (str, six.text_type)), path\n        assert isinstance(mode, (str, six.text_type)), mode\n        assert isinstance(type, (str, six.text_type)), type\n        assert content is github.GithubObject.NotSet or isinstance(\n            content, (str, six.text_type)\n        ), content\n        assert (\n            sha is github.GithubObject.NotSet\n            or sha is None\n            or isinstance(sha, (str, six.text_type))\n        ), sha\n        self.__path = path\n        self.__mode = mode\n        self.__type = type\n        self.__content = content\n        self.__sha = sha\n\n    @property\n    def _identity(self):\n        identity = {\n            \"path\": self.__path,\n            \"mode\": self.__mode,\n            \"type\": self.__type,\n        }\n        if self.__sha is not github.GithubObject.NotSet:\n            identity[\"sha\"] = self.__sha\n        if self.__content is not github.GithubObject.NotSet:\n            identity[\"content\"] = self.__content\n        return identity\n", "path": "github/InputGitTreeElement.py"}]}