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.
- {batchfetch-1.1.5/batchfetch.egg-info → batchfetch-1.1.7}/PKG-INFO +1 -1
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_git.py +22 -14
- {batchfetch-1.1.5 → batchfetch-1.1.7/batchfetch.egg-info}/PKG-INFO +1 -1
- {batchfetch-1.1.5 → batchfetch-1.1.7}/setup.py +1 -1
- {batchfetch-1.1.5 → batchfetch-1.1.7}/.gitignore +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/LICENSE +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/README.md +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/__init__.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_base.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/batchfetch_cli.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch/helpers.py +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/SOURCES.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/dependency_links.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/entry_points.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/requires.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/batchfetch.egg-info/top_level.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/run_tests.sh +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/setup.cfg +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/data/test-md5sum.txt +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/data/test-run_simple.sh +0 -0
- {batchfetch-1.1.5 → batchfetch-1.1.7}/tests/test_helpers.py +0 -0
|
@@ -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.
|
|
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
|
|
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(
|
|
196
|
+
commit_ref = self._git_tags(self["reference"] +
|
|
195
197
|
"^{commit}")[0]
|
|
196
|
-
self.branch_commit_ref = commit_ref.strip()
|
|
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
|
|
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
|
-
|
|
240
|
-
|
|
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()
|
|
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()
|
|
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
|
-
|
|
419
|
-
|
|
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.
|
|
441
|
+
self._update_current_branch_name()
|
|
434
442
|
|
|
435
443
|
return branch_changed
|
|
436
444
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|