Skip to content

Commit

Permalink
Merge pull request #197 from openlawlibrary/release/0.13.3
Browse files Browse the repository at this point in the history
Release/0.13.3
  • Loading branch information
tlewandowski18 authored Nov 18, 2021
2 parents bb58731 + 7d48b6b commit ec5a3b3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ and this project adheres to [Semantic Versioning][semver].
### Fixed


## [0.13.3] - 11/18/2021


### Added


### Changed

- Update create local branch git command - remove checkout ([197])
- Iterate throuh all urls when checking if a local repo is synced with remote ([197])


### Fixed


[197]: https://github.com/openlawlibrary/taf/pull/197



## [0.13.2] - 11/11/2021


Expand Down Expand Up @@ -582,7 +601,8 @@ and this project adheres to [Semantic Versioning][semver].
[keepachangelog]: https://keepachangelog.com/en/1.0.0/
[semver]: https://semver.org/spec/v2.0.0.html

[Unreleased]: https://github.com/openlawlibrary/taf/compare/v0.13.2...HEAD
[Unreleased]: https://github.com/openlawlibrary/taf/compare/v0.13.3...HEAD
[0.13.3]: https://github.com/openlawlibrary/taf/compare/v0.13.2...v0.13.3
[0.13.2]: https://github.com/openlawlibrary/taf/compare/v0.13.1...v0.13.2
[0.13.1]: https://github.com/openlawlibrary/taf/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/openlawlibrary/taf/compare/v0.12.0...v0.13.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

PACKAGE_NAME = "taf"
VERSION = "0.13.2"
VERSION = "0.13.3"
AUTHOR = "Open Law Library"
AUTHOR_EMAIL = "[email protected]"
DESCRIPTION = "Implementation of archival authentication"
Expand Down
38 changes: 19 additions & 19 deletions taf/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,7 @@ def create_local_branch(self, branch_name):
to check out previously checked out branch
"""
if not self.branch_exists(branch_name, include_remotes=False):
current_branch = self.get_current_branch()
self.checkout_branch(branch_name)
self.checkout_branch(current_branch)
self._git(f"branch {branch_name} {self.remotes[0]}/{branch_name}")

def checkout_commit(self, commit):
self._git(
Expand Down Expand Up @@ -852,23 +850,25 @@ def synced_with_remote(self, branch=None, url=None):
"""Checks if local branch is synced with its remote branch"""
# check if the latest local commit matches
# the latest remote commit on the specified branch
branch = branch or self.default_branch
if url is None:
if self.urls is not None and len(self.urls):
url = self.urls[0]
else:
url = self.get_remote_url()

tracking_branch = self.get_tracking_branch(branch, strip_remote=True)
if not tracking_branch:
return False
urls = (
[url]
if url is not None
else self.urls
if self.urls
else [self.get_remote_url()]
)
for url in urls:
branch = branch or self.default_branch
tracking_branch = self.get_tracking_branch(branch, strip_remote=True)
if not tracking_branch:
return False

try:
local_commit = self._git(f"rev-parse {branch}")
except GitError as e:
if "unknown revision or path not in the working tree" not in str(e):
raise e
local_commit = None
try:
local_commit = self._git(f"rev-parse {branch}")
except GitError as e:
if "unknown revision or path not in the working tree" not in str(e):
raise e
local_commit = None

remote_commit = self.get_last_remote_commit(url, tracking_branch)

Expand Down

0 comments on commit ec5a3b3

Please sign in to comment.