remove unused git stuff
This commit is contained in:
parent
531c609277
commit
792af96170
1 changed files with 0 additions and 37 deletions
|
@ -40,43 +40,6 @@ class JJController:
|
|||
|
||||
return res.stdout
|
||||
|
||||
def clean_paths(self, paths):
|
||||
paths = [self.root / p for p in paths]
|
||||
return [str(p.relative_to(self.root)) for p in paths if p.is_relative_to(self.root)]
|
||||
|
||||
@ensure_jj
|
||||
def ignore_paths(self, paths):
|
||||
paths = self.clean_paths(paths)
|
||||
gitignore = self.root / '.gitignore'
|
||||
if len(paths) == 0:
|
||||
return
|
||||
|
||||
if gitignore.exists():
|
||||
with open(gitignore) as f:
|
||||
ignored = f.read().strip().split('\n')
|
||||
ignored += [p for p in paths if p not in ignored]
|
||||
else:
|
||||
ignored = paths
|
||||
|
||||
with open(gitignore, 'w') as f:
|
||||
f.write('\n'.join(ignored))
|
||||
|
||||
@ensure_jj
|
||||
def remove_paths(self, paths):
|
||||
paths = self.clean_paths(paths)
|
||||
if len(paths) == 0:
|
||||
return
|
||||
|
||||
return self.run(['git','rm'] + paths)
|
||||
|
||||
@ensure_jj
|
||||
def add_paths(self, paths):
|
||||
paths = self.clean_paths(paths)
|
||||
if len(paths) == 0:
|
||||
return
|
||||
|
||||
return self.run(['git','add'] + paths)
|
||||
|
||||
@ensure_jj
|
||||
def commit(self, message):
|
||||
res = self.run(['jj','describe','--stdin','--no-edit'], input=message)
|
||||
|
|
Loading…
Reference in a new issue