Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork941
Commit1207747
Use the Git class type definition within Repo classmethods
Allow the GitCommandWrapperType definition to be used within the Repoclassmethods. This change follows the intended purpose as stated inthe code, "Subclasses may easily bring in their own custom types byplacing a constructor or type here."The usecase that prompted this change has to do with`GIT_SSH_COMMAND`. The goal is to setup a custom `Git` class withknowledge of the value, something like as follows```pythonfrom git import Git as BaseGit, Repo as BaseRepoclass Git(BaseGit): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # For example, assign the SSH command using the current flask # app's configured setting. self.update_environment(GIT_SSH_COMMAND=current_app.config['GIT_SSH_COMMAND'])class Repo(BaseRepo): GitCommandWrapperType = _Git```With this change, the above example will allow the developer to use`Repo.clone_from(...)` with the indended outcome. Otherwise thedeveloper will have two differing result when using `Repo(...)` vs`Repo.clone_from(...)`.1 parentbd0fa88 commit1207747
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
1045 |
| - | |
| 1045 | + | |
1046 | 1046 |
| |
1047 | 1047 |
| |
1048 | 1048 |
| |
| |||
1142 | 1142 |
| |
1143 | 1143 |
| |
1144 | 1144 |
| |
1145 |
| - | |
| 1145 | + | |
1146 | 1146 |
| |
1147 | 1147 |
| |
1148 | 1148 |
| |
|
0 commit comments
Comments
(0)