batchfetch 1.3.4__tar.gz → 1.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.3.4
3
+ Version: 1.3.5
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -111,6 +111,7 @@ class BatchFetchCli:
111
111
  # Paths specified in the batchfetch.yaml file
112
112
  untracked_paths = None
113
113
  if "options" in yaml_dict and \
114
+ isinstance(yaml_dict["options"], dict) and \
114
115
  "ignore_untracked" in yaml_dict["options"]:
115
116
  untracked_paths = \
116
117
  yaml_dict["options"]["ignore_untracked"]
@@ -117,7 +117,7 @@ class BatchFetchGit(TaskBatchFetch):
117
117
 
118
118
  self.add_output(f"[GIT {update_type}] {self[self.main_key]}"
119
119
  + (f" (Ref: {self['revision']})"
120
- if self["revision"] else "") + "\n")
120
+ if self["revision"] else "") + "\n")
121
121
 
122
122
  try:
123
123
  # Delete
@@ -130,32 +130,34 @@ class BatchFetchGit(TaskBatchFetch):
130
130
 
131
131
  # Update
132
132
  if self.git_local_dir.is_dir():
133
+ do_git_fetch = self["git_pull"]
134
+
133
135
  # Pre exec
134
- self._update_current_branch_name()
136
+ if do_git_fetch:
137
+ self._update_current_branch_name()
138
+
135
139
  self._repo_fix_remote_origin()
136
140
  self._exec_before(cwd=self.git_local_dir)
137
141
 
138
142
  if not self["revision"]:
139
143
  self.values["revision"] = self._run_get_firstline(
140
- "git symbolic-ref refs/remotes/origin/HEAD"
141
- ).split("/")[-1]
144
+ "git symbolic-ref --short HEAD")
142
145
  if not self["revision"]:
143
146
  raise BatchFetchError(
144
147
  "Unable to determine the default origin branch"
145
148
  )
146
149
 
147
150
  self.add_output(self.indent_spaces +
148
- f"[INFO] Update revision to: '" +
151
+ "[INFO] Update revision to: '" +
149
152
  self["revision"] + "'\n")
150
153
 
151
- git_fetch_done = self._repo_fetch()
154
+ if do_git_fetch:
155
+ git_fetch_done = self._repo_fetch()
152
156
 
153
- git_branch_changed = False
154
- git_branch_changed = self._repo_fix_branch()
157
+ self._repo_fix_branch()
155
158
 
156
- git_merge_done = False
157
159
  if git_fetch_done:
158
- git_merge_done = self._git_merge()
160
+ self._git_merge()
159
161
 
160
162
  if self.get_changed():
161
163
  self._exec_after(cwd=self.git_local_dir)
@@ -192,6 +194,8 @@ class BatchFetchGit(TaskBatchFetch):
192
194
 
193
195
  :param cmd: Command to be executed. Can be a list or a string.
194
196
  :param kwargs: Additional keyword arguments for Popen.
197
+ :cwd: Current working directory.
198
+ :env: Environment variables.
195
199
  :return: Tuple containing two lists: stdout lines and stderr lines.
196
200
  """
197
201
  if not cwd:
@@ -264,11 +268,10 @@ class BatchFetchGit(TaskBatchFetch):
264
268
  # Merge
265
269
  do_git_fetch = self["git_pull"]
266
270
  do_git_fetch = False
267
- commit_ref = None
268
271
 
269
272
  try:
270
273
  # Check if the revision such as
271
- stdout, _ = self._run(["git", "cat-file", "-e", self["revision"]])
274
+ _, _ = self._run(["git", "cat-file", "-e", self["revision"]])
272
275
  except subprocess.CalledProcessError:
273
276
  do_git_fetch = True
274
277
  self.add_output(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.3.4
3
+ Version: 1.3.5
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -22,7 +22,7 @@ from setuptools import find_packages, setup
22
22
 
23
23
  setup(
24
24
  name="batchfetch",
25
- version="1.3.4",
25
+ version="1.3.5",
26
26
  packages=find_packages(),
27
27
  description="Efficiently clone and pull multiple Git repositories.",
28
28
  license="GPLv3",
File without changes
File without changes
File without changes