Skip to content

Commit

Permalink
Merge pull request #3 from Eun/master
Browse files Browse the repository at this point in the history
Check if any parent directory has .sublime-text-git-autocommit
  • Loading branch information
dmitrygusev committed Sep 2, 2015
2 parents e9b6340 + 73eb393 commit 915cd82
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions git-autocommit.py
Expand Up @@ -9,11 +9,19 @@
import Git.git
import Git.add

def is_auto_commit_file_exists(root, parent = ""):
if root == parent:
return False
marker_file = root + "/.sublime-text-git-autocommit"
if not os.path.exists(marker_file):
return is_auto_commit_file_exists(os.path.dirname(root), root)
else:
return True

def is_file_from_autocommit_list(view):
# Right now all files from folder with special "marker"-file considered to be auto-committed
# TODO: Maybe put a list of auto-committed files to the "marker"-file? One filename per line
marker_file = os.path.realpath(os.path.dirname(view.file_name())) + "/.sublime-text-git-autocommit"
return os.path.exists(marker_file)
return is_auto_commit_file_exists(os.path.realpath(os.path.dirname(view.file_name())))

'''
Inspired by:
Expand Down

0 comments on commit 915cd82

Please sign in to comment.