This is to avoid confusion with the Stack.head function which returns
a commit object rather than a file name. The patch also changes the
"new" function to use stack.head directly rather than via the
Repository.refs... object.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
else:
parser.error('incorrect number of arguments')
else:
parser.error('incorrect number of arguments')
- head = directory.repository.refs.get(directory.repository.head)
- tree = head.data.tree, parents = [head], message = '',
+ tree = stack.head.data.tree, parents = [stack.head], message = '',
author = gitlib.Person.author(), committer = gitlib.Person.committer())
# Set patch commit message from commandline.
author = gitlib.Person.author(), committer = gitlib.Person.committer())
# Set patch commit message from commandline.
).output_one_line()
return self.get_commit(sha1)
@property
).output_one_line()
return self.get_commit(sha1)
@property
try:
return self.run(['git', 'symbolic-ref', '-q', 'HEAD']
).output_one_line()
except run.RunException:
raise DetachedHeadException()
try:
return self.run(['git', 'symbolic-ref', '-q', 'HEAD']
).output_one_line()
except run.RunException:
raise DetachedHeadException()
- def set_head(self, ref, msg):
+ def set_head_ref(self, ref, msg):
self.run(['git', 'symbolic-ref', '-m', msg, 'HEAD', ref]).no_output()
def simple_merge(self, base, ours, theirs):
"""Given three L{Tree}s, tries to do an in-index merge with a
self.run(['git', 'symbolic-ref', '-m', msg, 'HEAD', ref]).no_output()
def simple_merge(self, base, ours, theirs):
"""Given three L{Tree}s, tries to do an in-index merge with a
self.__stacks = {} # name -> Stack
@property
def current_branch(self):
self.__stacks = {} # name -> Stack
@property
def current_branch(self):
- return utils.strip_leading('refs/heads/', self.head)
+ return utils.strip_leading('refs/heads/', self.head_ref)
@property
def current_stack(self):
return self.get_stack()
@property
def current_stack(self):
return self.get_stack()