Skip to content

Commit

Permalink
Ignore custom gitignore file.
Browse files Browse the repository at this point in the history
  • Loading branch information
peteruhnak committed Feb 8, 2012
1 parent 686656e commit 8406232
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def main():
if os.path.isfile(options.ftp.gitftpignore):
with open(options.ftp.gitftpignore, 'r') as ftpignore:
patterns = parse_ftpignore(ftpignore)
patterns.append('/' + options.ftp.gitftpignore)

if not hash:
# Diffing against an empty tree will cause a full upload.
Expand Down Expand Up @@ -408,12 +409,12 @@ def generate_parent_dirs(x):
module_base = posixpath.join(base, node.path)
logging.info('Entering submodule %s', node.path)
ftp.cwd(module_base)
upload_diff(module, module_oldtree, module_tree, ftp, module_base)
upload_diff(module, module_oldtree, module_tree, ftp, module_base, ignored)
logging.info('Leaving submodule %s', node.path)
ftp.cwd(base)

def is_ignored_path(path, patterns, quiet = False):
"""Returns true if a filepath is ignored by ftpgitignore."""
"""Returns true if a filepath is ignored by gitftpignore."""
if is_special_file(path):
if not quiet: logging.info('Skipped ' + path[1:])
return True
Expand All @@ -424,7 +425,7 @@ def is_ignored_path(path, patterns, quiet = False):

def is_special_file(name):
"""Returns true if a file is some special Git metadata and not content."""
return posixpath.basename(name) in ['.gitignore', '.gitattributes', '.gitmodules', '.gitftpignore']
return posixpath.basename(name) in ['.gitignore', '.gitattributes', '.gitmodules']

def upload_blob(blob, ftp, quiet = False):
"""
Expand Down

0 comments on commit 8406232

Please sign in to comment.