diff options
author | Luis R. Rodriguez <mcgrof@suse.com> | 2014-11-06 14:48:14 -0800 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-11-14 13:47:16 -0800 |
commit | 4e2be7f0612bc70552f67d8a98942a823498ef9e (patch) | |
tree | 6f3984af8854fa97ed375dee8baa10072d3e0b35 /gentree.py | |
parent | 2a4dab4316c24125fd95687ec2adafb1345d6547 (diff) |
backports: avoid git tree reinitialization
When using backports against for packaging with --gitdebug you either
have to use --clean or assume the directory is empty already. In either
case you start fresh. With integration this will be a bit different, you
could end up with a project directory where the git tree was present but
only the target directory was empty.
Calling git init on an already existing git directory will reinitialize
your git tree, that can reset some config stuff, let's avoid that.
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-x | gentree.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -288,7 +288,10 @@ def git_debug_init(args): """ if not args.gitdebug: return - git.init(tree=args.bpid.project_dir) + # Git supports re-initialization, although not well documented it can + # reset config stuff, lets avoid that if the tree already exists. + if not os.path.exists(os.path.join(args.bpid.project_dir, '.git')): + git.init(tree=args.bpid.project_dir) git.commit_all("Copied backport", tree=args.bpid.project_dir) |