batchfetch 1.1.1__tar.gz → 1.1.2__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.
Files changed (21) hide show
  1. {batchfetch-1.1.1/batchfetch.egg-info → batchfetch-1.1.2}/PKG-INFO +1 -1
  2. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch/batchfetch_base.py +1 -1
  3. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch/batchfetch_git.py +24 -14
  4. {batchfetch-1.1.1 → batchfetch-1.1.2/batchfetch.egg-info}/PKG-INFO +1 -1
  5. {batchfetch-1.1.1 → batchfetch-1.1.2}/setup.py +1 -1
  6. {batchfetch-1.1.1 → batchfetch-1.1.2}/.gitignore +0 -0
  7. {batchfetch-1.1.1 → batchfetch-1.1.2}/LICENSE +0 -0
  8. {batchfetch-1.1.1 → batchfetch-1.1.2}/README.md +0 -0
  9. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch/__init__.py +0 -0
  10. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch/batchfetch_cli.py +0 -0
  11. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch/helpers.py +0 -0
  12. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch.egg-info/SOURCES.txt +0 -0
  13. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch.egg-info/dependency_links.txt +0 -0
  14. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch.egg-info/entry_points.txt +0 -0
  15. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch.egg-info/requires.txt +0 -0
  16. {batchfetch-1.1.1 → batchfetch-1.1.2}/batchfetch.egg-info/top_level.txt +0 -0
  17. {batchfetch-1.1.1 → batchfetch-1.1.2}/run_tests.sh +0 -0
  18. {batchfetch-1.1.1 → batchfetch-1.1.2}/setup.cfg +0 -0
  19. {batchfetch-1.1.1 → batchfetch-1.1.2}/tests/data/test-md5sum.txt +0 -0
  20. {batchfetch-1.1.1 → batchfetch-1.1.2}/tests/data/test-run_simple.sh +0 -0
  21. {batchfetch-1.1.1 → batchfetch-1.1.2}/tests/test_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -58,7 +58,7 @@ class TaskBase:
58
58
 
59
59
  # Options
60
60
  self.options = {}
61
- self.options.update(deepcopy(self.global_options_values)) # Default
61
+ self.options.update(deepcopy(self.global_options_values))
62
62
  self.options.update(deepcopy(self._item_options))
63
63
  schema = Schema(self.global_options_schema)
64
64
  schema.validate(self.options)
@@ -227,21 +227,31 @@ class BatchFetchGit(BatchFetchBase):
227
227
  do_git_pull = True
228
228
  else: # The reference exists
229
229
  try:
230
- # If the tag is annotated, it points to a tag object, not
231
- # directly to a commit. You need to resolve it to the
232
- # commit it points to. Using `git rev-parse
233
- # <tagname>^{commit}` allows getting the right reference.
234
- commit_ref_head = self._git_tags("HEAD^{commit}")[0]
235
- except GitReferenceDoesNotExist:
236
- # HEAD is detached
237
- commit_ref_head = None
238
-
239
- # The wanted commit reference does not exist
240
- # Or the commit ref of HEAD hasn't changed
241
- if commit_ref and commit_ref_head == commit_ref:
242
- do_git_pull = False
243
- else:
230
+ cmd = ["git", "show-ref", "--verify", "--quiet",
231
+ f"refs/heads/{self['reference']}"]
232
+ run_simple(cmd, env=self.env, cwd=self.git_local_dir)
244
233
  do_git_pull = True
234
+ except subprocess.CalledProcessError:
235
+ pass
236
+
237
+ if not do_git_pull:
238
+ try:
239
+ # If the tag is annotated, it points to a tag object,
240
+ # not directly to a commit. You need to resolve it to
241
+ # the commit it points to. Using `git rev-parse
242
+ # <tagname>^{commit}` allows getting the right
243
+ # reference.
244
+ commit_ref_head = self._git_tags("HEAD^{commit}")[0]
245
+ except GitReferenceDoesNotExist:
246
+ # HEAD is detached
247
+ commit_ref_head = None
248
+
249
+ # The wanted commit reference does not exist
250
+ # Or the commit ref of HEAD hasn't changed
251
+ if commit_ref and commit_ref_head == commit_ref:
252
+ do_git_pull = False
253
+ else:
254
+ do_git_pull = True
245
255
 
246
256
  if not do_git_pull:
247
257
  self.add_output(self.indent_spaces + "[INFO] git pull ignored\n")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.1.1
3
+ Version: 1.1.2
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.1.1",
25
+ version="1.1.2",
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
File without changes
File without changes