~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the --noreply option to 'mail'
[stgit]
/
stgit
/
git.py
diff --git
a/stgit/git.py
b/stgit/git.py
index
907c82d
..
025d15d
100644
(file)
--- a/
stgit/git.py
+++ b/
stgit/git.py
@@
-59,7
+59,11
@@
class Commit:
return self.__tree
def get_parent(self):
return self.__tree
def get_parent(self):
- return self.get_parents()[0]
+ parents = self.get_parents()
+ if parents:
+ return parents[0]
+ else:
+ return None
def get_parents(self):
return _output_lines('git-rev-list --parents --max-count=1 %s'
def get_parents(self):
return _output_lines('git-rev-list --parents --max-count=1 %s'
@@
-436,7
+440,9
@@
def commit(message, files = None, parents = None, allowempty = False,
raise GitException, 'No changes to commit'
# get the commit message
raise GitException, 'No changes to commit'
# get the commit message
- if message[-1:] != '\n':
+ if not message:
+ message = '\n'
+ elif message[-1:] != '\n':
message += '\n'
must_switch = True
message += '\n'
must_switch = True