Coverage for /home/pradyumna/Languages/python/packages/pyprojstencil/pyprojstencil/init_git.py: 0%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

7 statements  

1#!/usr/bin/env python3 

2# -*- coding:utf-8; mode:python; -*- 

3# 

4# Copyright 2021 Pradyumna Paranjape 

5# This file is part of pyprojstencil. 

6# 

7# pyprojstencil is free software: you can redistribute it and/or modify 

8# it under the terms of the GNU Lesser General Public License as published by 

9# the Free Software Foundation, either version 3 of the License, or 

10# (at your option) any later version. 

11# 

12# pyprojstencil is distributed in the hope that it will be useful, 

13# but WITHOUT ANY WARRANTY; without even the implied warranty of 

14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

15# GNU Lesser General Public License for more details. 

16# 

17# You should have received a copy of the GNU Lesser General Public License 

18# along with pyprojstencil. If not, see <https://www.gnu.org/licenses/>. 

19# 

20""" 

21Initialize git repository 

22""" 

23 

24import git 

25 

26from pyprojstencil.configure import PyConfig 

27 

28 

29def init_git_repo(config: PyConfig): 

30 """ 

31 Initialize a git project 

32 

33 Args: 

34 config: configuration for project 

35 """ 

36 proj_repo = git.Repo.init(config.project, initial_branch=config.branch) 

37 proj_repo.git.add(":/") 

38 proj_repo.index.commit('initial auto commit by pyprojstencil')