batchfetch 1.1.5__tar.gz → 1.1.7__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.5/batchfetch.egg-info → batchfetch-1.1.7}/PKG-INFO +1 -1
  2. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_git.py +22 -14
  3. {batchfetch-1.1.5 → batchfetch-1.1.7/batchfetch.egg-info}/PKG-INFO +1 -1
  4. {batchfetch-1.1.5 → batchfetch-1.1.7}/setup.py +1 -1
  5. {batchfetch-1.1.5 → batchfetch-1.1.7}/.gitignore +0 -0
  6. {batchfetch-1.1.5 → batchfetch-1.1.7}/LICENSE +0 -0
  7. {batchfetch-1.1.5 → batchfetch-1.1.7}/README.md +0 -0
  8. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/__init__.py +0 -0
  9. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_base.py +0 -0
  10. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_cli.py +0 -0
  11. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/helpers.py +0 -0
  12. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/SOURCES.txt +0 -0
  13. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/dependency_links.txt +0 -0
  14. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/entry_points.txt +0 -0
  15. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/requires.txt +0 -0
  16. {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/top_level.txt +0 -0
  17. {batchfetch-1.1.5 → batchfetch-1.1.7}/run_tests.sh +0 -0
  18. {batchfetch-1.1.5 → batchfetch-1.1.7}/setup.cfg +0 -0
  19. {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/data/test-md5sum.txt +0 -0
  20. {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/data/test-run_simple.sh +0 -0
  21. {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/test_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.1.5
3
+ Version: 1.1.7
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -128,7 +128,7 @@ class BatchFetchGit(TaskBatchFetch):
128
128
  # Update
129
129
  if self.git_local_dir.is_dir():
130
130
  # Pre exec
131
- self._update_current_branch()
131
+ self._update_current_branch_name()
132
132
  self._repo_fix_remote_origin()
133
133
  self._run_pre_exec(cwd=self.git_local_dir)
134
134
 
@@ -173,14 +173,16 @@ class BatchFetchGit(TaskBatchFetch):
173
173
  return ""
174
174
  return output
175
175
 
176
- def _update_current_branch(self):
176
+ def _update_current_branch_name(self):
177
177
  try:
178
+ # This returns the branch name
178
179
  stdout, _ = run_simple(
179
180
  ["git", "symbolic-ref", "--short", "HEAD"],
180
181
  env=self.env,
181
182
  cwd=self.git_local_dir,
182
183
  )
183
- self.current_branch = stdout[0]
184
+ self.current_branch = stdout[0].strip()
185
+ self.is_branch = True
184
186
  except (IndexError, subprocess.CalledProcessError):
185
187
  # Not a symbolic ref
186
188
  self.current_branch = None
@@ -191,10 +193,9 @@ class BatchFetchGit(TaskBatchFetch):
191
193
  # directly to a commit. You need to resolve it to the
192
194
  # commit it points to. Using `git rev-parse
193
195
  # <tagname>^{commit}` allows getting the right reference.
194
- commit_ref = self._git_tags("origin/" + self["reference"] +
196
+ commit_ref = self._git_tags(self["reference"] +
195
197
  "^{commit}")[0]
196
- self.branch_commit_ref = commit_ref.strip().lower()
197
- self.is_branch = True
198
+ self.branch_commit_ref = commit_ref.strip()
198
199
  except GitReferenceDoesNotExist:
199
200
  pass
200
201
 
@@ -233,11 +234,13 @@ class BatchFetchGit(TaskBatchFetch):
233
234
 
234
235
  # Merge
235
236
  do_git_pull = self["git_pull"]
236
- if not self["reference"]:
237
+ if self.is_branch:
238
+ do_git_pull = True
239
+ elif not self["reference"]:
237
240
  do_git_pull = True
238
241
  self.add_output(self.indent_spaces +
239
- "[INFO] Git fetch origin reason: " +
240
- "No 'reference:' specified\n")
242
+ "[INFO] Git fetch origin reason: " +
243
+ "No 'reference:' specified\n")
241
244
  else:
242
245
  do_git_pull = False
243
246
  commit_ref = None
@@ -246,7 +249,7 @@ class BatchFetchGit(TaskBatchFetch):
246
249
  # Check if the reference such as
247
250
  # 0560fe21d1173b2221fd8c600fab818f7eecbad4 exist
248
251
  commit_ref = self._git_tags(self["reference"])[0]
249
- commit_ref = commit_ref.strip().lower()
252
+ commit_ref = commit_ref.strip()
250
253
  except GitReferenceDoesNotExist:
251
254
  pass
252
255
 
@@ -280,7 +283,7 @@ class BatchFetchGit(TaskBatchFetch):
280
283
  # # <tagname>^{commit}` allows getting the right
281
284
  # # reference.
282
285
  # commit_ref_head = self._git_tags("HEAD^{commit}")[0]
283
- # commit_ref_head = commit_ref_head.strip().lower()
286
+ # commit_ref_head = commit_ref_head.strip()
284
287
  # except GitReferenceDoesNotExist:
285
288
  # # HEAD is detached
286
289
  # commit_ref_head = None
@@ -411,12 +414,17 @@ class BatchFetchGit(TaskBatchFetch):
411
414
  # Also check the commit reference in case
412
415
  # branch is a commit reference instead of a tag
413
416
  try:
417
+ # Check if the branch exists
414
418
  git_ref_branch = self._git_tags("origin/" +
415
419
  self["reference"] +
416
420
  "^{commit}")[0]
417
421
  except GitReferenceDoesNotExist as err:
418
- raise BatchFetchError(f"The branch '{self['reference']}' "
419
- "does not exist.") from err
422
+ # Check if the commit ref exists
423
+ try:
424
+ git_ref_branch = self._git_tags(self["reference"])[0]
425
+ except GitReferenceDoesNotExist as err:
426
+ raise BatchFetchError(f"The branch '{self['reference']}' "
427
+ "does not exist.") from err
420
428
 
421
429
  if git_ref_after_merge != git_ref_branch and \
422
430
  self["reference"] not in git_tags:
@@ -430,7 +438,7 @@ class BatchFetchGit(TaskBatchFetch):
430
438
  branch_changed = True
431
439
 
432
440
  # Read branch again
433
- self._update_current_branch()
441
+ self._update_current_branch_name()
434
442
 
435
443
  return branch_changed
436
444
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.1.5
3
+ Version: 1.1.7
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.5",
25
+ version="1.1.7",
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