Skip to content

Commit 8b1f392

Browse files
Fix/branch option (#645)
* fix/branch-option updating changelog, fix branch specification * fix/branch-option updating changelog, fix branch specification * fix/branch-option linting
1 parent 14329fd commit 8b1f392

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed ability to specify branch for Netlaify
13+
14+
## [v0.18.13] - 2025-01-29
15+
16+
### Added
17+
18+
- Add ability to specify branch for Netlify
19+
1020
## [v0.18.12] - 2025-01-29
1121

1222
### Added

snooty/parser.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,16 +1751,20 @@ def __init__(
17511751
)
17521752

17531753
username = getpass.getuser()
1754-
try:
1755-
branch = subprocess.check_output(
1756-
["git", "rev-parse", "--abbrev-ref", "HEAD"],
1757-
cwd=root,
1758-
encoding="utf-8",
1759-
stderr=subprocess.PIPE,
1760-
).strip()
1761-
except subprocess.CalledProcessError as err:
1762-
logger.info("git error getting branch name: %s", err.stderr)
1763-
branch = "current"
1754+
1755+
if custom_branch:
1756+
branch = custom_branch
1757+
else:
1758+
try:
1759+
branch = subprocess.check_output(
1760+
["git", "rev-parse", "--abbrev-ref", "HEAD"],
1761+
cwd=root,
1762+
encoding="utf-8",
1763+
stderr=subprocess.PIPE,
1764+
).strip()
1765+
except subprocess.CalledProcessError as err:
1766+
logger.info("git error getting branch name: %s", err.stderr)
1767+
branch = "current"
17641768

17651769
self.prefix = [self.config.name, username, branch]
17661770

@@ -1769,9 +1773,6 @@ def __init__(
17691773
self.config, self.targets.copy_clean_slate()
17701774
)
17711775

1772-
if custom_branch:
1773-
branch = custom_branch
1774-
17751776
self.asset_dg: "networkx.DiGraph[FileId]" = networkx.DiGraph()
17761777
self.backend.on_config(self.config, branch)
17771778

0 commit comments

Comments
 (0)