File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ class FtpDataOldVersion(Exception):
6363class FtpSslNotSupported (Exception ):
6464 pass
6565
66+ class SectionNotFound (Exception ):
67+ pass
68+
6669def main ():
6770 Git .git_binary = 'git' # Windows doesn't like env
6871
@@ -196,9 +199,14 @@ def get_ftp_creds(repo, options):
196199 logging .info ("Using .git/ftpdata" )
197200 cfg .read (ftpdata )
198201
199- if (not cfg .has_section (options .section )) and cfg .has_section ('ftp' ):
200- raise FtpDataOldVersion ("Please rename the [ftp] section to [branch]. " +
201- "Take a look at the README for more information" )
202+ if (not cfg .has_section (options .section )):
203+ if cfg .has_section ('ftp' ):
204+ raise FtpDataOldVersion ("Please rename the [ftp] section to [branch]. " +
205+ "Take a look at the README for more information" )
206+ else :
207+ raise SectionNotFound ("Your .git/ftpdata file does not contain a section " +
208+ "named '%s'" % options .section )
209+
202210
203211 # just in case you do not want to store your ftp password.
204212 try :
You can’t perform that action at this time.
0 commit comments