batchfetch 1.1.7__tar.gz → 1.1.8__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.7/batchfetch.egg-info → batchfetch-1.1.8}/PKG-INFO +1 -1
  2. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch/batchfetch_git.py +42 -41
  3. {batchfetch-1.1.7 → batchfetch-1.1.8/batchfetch.egg-info}/PKG-INFO +1 -1
  4. {batchfetch-1.1.7 → batchfetch-1.1.8}/setup.py +1 -1
  5. {batchfetch-1.1.7 → batchfetch-1.1.8}/.gitignore +0 -0
  6. {batchfetch-1.1.7 → batchfetch-1.1.8}/LICENSE +0 -0
  7. {batchfetch-1.1.7 → batchfetch-1.1.8}/README.md +0 -0
  8. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch/__init__.py +0 -0
  9. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch/batchfetch_base.py +0 -0
  10. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch/batchfetch_cli.py +0 -0
  11. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch/helpers.py +0 -0
  12. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch.egg-info/SOURCES.txt +0 -0
  13. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch.egg-info/dependency_links.txt +0 -0
  14. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch.egg-info/entry_points.txt +0 -0
  15. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch.egg-info/requires.txt +0 -0
  16. {batchfetch-1.1.7 → batchfetch-1.1.8}/batchfetch.egg-info/top_level.txt +0 -0
  17. {batchfetch-1.1.7 → batchfetch-1.1.8}/run_tests.sh +0 -0
  18. {batchfetch-1.1.7 → batchfetch-1.1.8}/setup.cfg +0 -0
  19. {batchfetch-1.1.7 → batchfetch-1.1.8}/tests/data/test-md5sum.txt +0 -0
  20. {batchfetch-1.1.7 → batchfetch-1.1.8}/tests/data/test-run_simple.sh +0 -0
  21. {batchfetch-1.1.7 → batchfetch-1.1.8}/tests/test_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.1.7
3
+ Version: 1.1.8
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -136,8 +136,7 @@ class BatchFetchGit(TaskBatchFetch):
136
136
 
137
137
  git_merge_done = self._repo_pull()
138
138
  git_branch_changed = False
139
- if self.is_branch:
140
- git_branch_changed = self._repo_fix_branch()
139
+ git_branch_changed = self._repo_fix_branch()
141
140
 
142
141
  if git_merge_done or git_branch_changed:
143
142
  self._repo_update_submodules()
@@ -254,50 +253,52 @@ class BatchFetchGit(TaskBatchFetch):
254
253
  pass
255
254
 
256
255
  if not commit_ref and not self.is_branch:
256
+ do_git_pull = True
257
257
  self.add_output(
258
258
  self.indent_spaces +
259
- "[INFO] Git fetch origin reason:" +
259
+ "[INFO] Git fetch origin reason: " +
260
260
  f"The reference does not exist: {self['reference']}" +
261
261
  "\n")
262
262
 
263
- if not do_git_pull:
264
- try:
265
- # Check if the branch is a tag or a branch
266
- cmd = ["git", "show-ref", "--verify", "--quiet",
267
- f"refs/heads/{self['reference']}"]
268
- run_simple(cmd, env=self.env, cwd=self.git_local_dir)
269
- self.add_output(
270
- self.indent_spaces +
271
- "[INFO] Git fetch origin reason:" +
272
- f"{self['reference']} is a branch, not a tag" +
273
- "\n")
274
- do_git_pull = True
275
- except subprocess.CalledProcessError:
276
- pass
277
-
278
- # if not do_git_pull:
279
- # try:
280
- # # If the tag is annotated, it points to a tag object,
281
- # # not directly to a commit. You need to resolve it to
282
- # # the commit it points to. Using `git rev-parse
283
- # # <tagname>^{commit}` allows getting the right
284
- # # reference.
285
- # commit_ref_head = self._git_tags("HEAD^{commit}")[0]
286
- # commit_ref_head = commit_ref_head.strip()
287
- # except GitReferenceDoesNotExist:
288
- # # HEAD is detached
289
- # commit_ref_head = None
290
- #
291
- # # The wanted commit reference does not exist
292
- # # Or the commit ref of HEAD hasn't changed
293
- # if not commit_ref_head or commit_ref_head != commit_ref:
294
- # self.add_output(
295
- # self.indent_spaces +
296
- # "[INFO] Git fetch origin reason: "
297
- # f"Commit ref head '{commit_ref_head}' != "
298
- # f"commit ref '{commit_ref_head}'"
299
- # "\n")
300
- # do_git_pull = True
263
+ if not do_git_pull:
264
+ try:
265
+ # Check if the branch is a tag or a branch
266
+ cmd = ["git", "show-ref", "--verify", "--quiet",
267
+ f"refs/heads/{self['reference']}"]
268
+ run_simple(cmd, env=self.env, cwd=self.git_local_dir)
269
+ self.add_output(
270
+ self.indent_spaces +
271
+ "[INFO] Git fetch origin reason:" +
272
+ f"{self['reference']} is a branch, not a tag" +
273
+ "\n")
274
+ do_git_pull = True
275
+ except subprocess.CalledProcessError:
276
+ pass
277
+
278
+ if not do_git_pull and commit_ref:
279
+ # This is to check if a tag has been changed
280
+ try:
281
+ # If the tag is annotated, it points to a tag object,
282
+ # not directly to a commit. You need to resolve it to
283
+ # the commit it points to. Using `git rev-parse
284
+ # <tagname>^{commit}` allows getting the right
285
+ # reference.
286
+ commit_ref_head = self._git_tags("HEAD^{commit}")[0]
287
+ commit_ref_head = commit_ref_head.strip()
288
+ except GitReferenceDoesNotExist:
289
+ # HEAD is detached
290
+ commit_ref_head = None
291
+
292
+ # The wanted commit reference does not exist
293
+ # Or the commit ref of HEAD hasn't changed
294
+ if not commit_ref_head or commit_ref_head != commit_ref:
295
+ self.add_output(
296
+ self.indent_spaces +
297
+ "[INFO] Git fetch origin reason: "
298
+ f"Commit ref head '{commit_ref_head}' != "
299
+ f"commit ref '{commit_ref_head}'"
300
+ "\n")
301
+ do_git_pull = True
301
302
 
302
303
  if not do_git_pull:
303
304
  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.7
3
+ Version: 1.1.8
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.7",
25
+ version="1.1.8",
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