Skip to content

Commit

Permalink
3057 Replacing 'master' to 'HEAD' for default git commit
Browse files Browse the repository at this point in the history
  • Loading branch information
VasiliiSurov committed Feb 13, 2021
1 parent 36d1bdd commit e88f1f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/dbt/clients/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _checkout(cwd, repo, branch):

def checkout(cwd, repo, branch=None):
if branch is None:
branch = 'master'
branch = 'HEAD'
try:
return _checkout(cwd, repo, branch)
except dbt.exceptions.CommandResultError as exc:
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/deps/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _checkout(self):

def _fetch_metadata(self, project, renderer) -> ProjectPackageMetadata:
path = self._checkout()
if self.revision == 'master' and self.warn_unpinned:
if self.revision == 'HEAD' and self.warn_unpinned:
warn_or_error(
'The git package "{}" is not pinned.\n\tThis can introduce '
'breaking changes into your project without warning!\n\nSee {}'
Expand Down Expand Up @@ -133,7 +133,7 @@ def incorporate(
def resolved(self) -> GitPinnedPackage:
requested = set(self.revisions)
if len(requested) == 0:
requested = {'master'}
requested = {'HEAD'}
elif len(requested) > 1:
raise_dependency_error(
'git dependencies should contain exactly one version. '
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_default_revision(self):

a_pinned = a.resolved()
self.assertEqual(a_pinned.name, 'http://example.com')
self.assertEqual(a_pinned.get_version(), 'master')
self.assertEqual(a_pinned.get_version(), 'HEAD')
self.assertEqual(a_pinned.source_type(), 'git')
self.assertIs(a_pinned.warn_unpinned, True)

Expand Down

0 comments on commit e88f1f1

Please sign in to comment.