@@ -60,7 +60,9 @@ def log_paths(logger, paths):
60
60
logger .info (f"PATHS:{ paths_list } " )
61
61
62
62
63
- def fetch_and_merge (repo_path , branch = None ):
63
+ def git_fetch_and_merge (args , repo_path , branch = None ):
64
+ if not args .enable_git :
65
+ return
64
66
try :
65
67
repo = Repo (repo_path )
66
68
origin = repo .remote (name = "origin" )
@@ -87,12 +89,16 @@ def fetch_and_merge(repo_path, branch=None):
87
89
raise QuantifyingException (f"Error during fetch and merge: { e } " , 1 )
88
90
89
91
90
- def add_and_commit (repo_path , add_path , message ):
92
+ def git_add_and_commit (args , repo_path , add_path , message ):
93
+ if not args .enable_git :
94
+ return args
91
95
try :
92
96
repo = Repo (repo_path )
93
- if not repo .is_dirty (untracked_files = True ):
94
- logging .info ("No changes to commit" )
95
- return
97
+ if not repo .is_dirty (untracked_files = True , path = add_path ):
98
+ relative_add_path = os .path .relpath (add_path , repo_path )
99
+ logging .info (f"No changes to commit in: { relative_add_path } " )
100
+ args .enable_git = False
101
+ return args
96
102
repo .index .add ([add_path ])
97
103
repo .index .commit (message )
98
104
logging .info (f"Changes committed: { message } " )
@@ -104,7 +110,9 @@ def add_and_commit(repo_path, add_path, message):
104
110
raise QuantifyingException (f"Error during add and commit: { e } " , 1 )
105
111
106
112
107
- def push_changes (repo_path ):
113
+ def git_push_changes (args , repo_path ):
114
+ if not args .enable_git :
115
+ return
108
116
try :
109
117
repo = Repo (repo_path )
110
118
origin = repo .remote (name = "origin" )
0 commit comments