Skip to content

Commit ca296f7

Browse files
authored
Update splunkversioncontrol_restore_class.py
1 parent bbdc4df commit ca296f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/splunkversioncontrol_restore_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def run_script(self, restlist_override=None, config_override=None):
934934

935935
dirExists = os.path.isdir(self.gitTempDir)
936936
if dirExists and len(os.listdir(self.gitTempDir)) != 0:
937-
if os.listdir(self.gitTempDir)[0] != ".git":
937+
if not ".git" in os.listdir(self.gitTempDir):
938938
#include the subdirectory which is the git repo
939939
self.gitTempDir = self.gitTempDir + "/" + os.listdir(self.gitTempDir)[0]
940940
logger.info("gitTempDir=%s" % (self.gitTempDir))
@@ -955,7 +955,7 @@ def run_script(self, restlist_override=None, config_override=None):
955955
else:
956956
logger.debug("i=\"%s\" result from git command: %s, output '%s' with stderroutput of '%s'" % (self.stanzaName, res, output, stderrout))
957957
logger.info("i=\"%s\" Successfully cloned the git URL=%s into directory dir=%s" % (self.stanzaName, self.gitRepoURL, self.gitTempDir))
958-
if os.listdir(self.gitTempDir)[0] != ".git":
958+
if not ".git" in os.listdir(self.gitTempDir):
959959
#include the subdirectory which is the git repo
960960
self.gitTempDir = self.gitTempDir + "/" + os.listdir(self.gitTempDir)[0]
961961
logger.debug("gitTempDir=%s" % (self.gitTempDir))

0 commit comments

Comments
 (0)