Try to fix to not assume master.
authorCarl Hetherington <cth@carlh.net>
Sun, 10 Oct 2021 08:42:56 +0000 (10:42 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 10 Oct 2021 08:42:56 +0000 (10:42 +0200)
cdist

diff --git a/cdist b/cdist
index 88c9bd40d238c0e043d4ed7bd70266c5f5611519..89aa0fa547143602efd212b751c18fcce6246b30 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -1015,11 +1015,8 @@ class Tree(object):
             command('git clone %s %s %s/%s.git %s/src/%s' % (flags, ref, config.get('git_prefix'), self.name, target.directory, self.name))
             os.chdir('%s/src/%s' % (target.directory, self.name))
 
-            spec = self.specifier
-            if spec is None:
-                spec = 'master'
-
-            command('git checkout %s %s %s' % (flags, spec, redirect))
+            if self.specifier is not None:
+                command('git checkout %s %s %s' % (flags, self.specifier, redirect))
             self.git_commit = command_and_read('git rev-parse --short=7 HEAD')[0].strip()
 
         self.cscript = {}