summaryrefslogtreecommitdiff
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-07-06 15:55:19 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 14:20:04 +0300
commitf000c937523a083c85df55736cb58c8da57b4d69 (patch)
tree116b544a305e1978190e1896b91aba61181e565c /gbp/git/repository.py
parent45e9e6771288f0021eadcf87ea08f0a9c4e19063 (diff)
downloadgit-buildpackage-f000c937523a083c85df55736cb58c8da57b4d69.tar.gz
git-buildpackage-f000c937523a083c85df55736cb58c8da57b4d69.tar.bz2
git-buildpackage-f000c937523a083c85df55736cb58c8da57b4d69.zip
GitRepository/add_files: add new option 'untracked'
With this option you can either only update already tracked files to index the (untracked=False) or add new files, too. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 02476722..6f10081f 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1323,7 +1323,7 @@ class GitRepository(object):
#{ Files
- def add_files(self, paths, force=False, index_file=None, work_tree=None):
+ def add_files(self, paths, force=False, untracked=True, index_file=None, work_tree=None):
"""
Add files to a the repository
@@ -1331,6 +1331,8 @@ class GitRepository(object):
@type paths: list or C{str}
@param force: add files even if they would be ignored by .gitignore
@type force: C{bool}
+ @param untracked: add also previously untracked files
+ @type untracked: C{bool}
@param index_file: alternative index file to use
@param work_tree: alternative working tree to use
"""
@@ -1338,7 +1340,7 @@ class GitRepository(object):
args = GitArgs()
args.add_true(force, '-f')
- args.add('-A')
+ args.add_cond(untracked, '-A', '-u')
args.add(paths)
if index_file: