From 32a4e200ade6693f98cab1118d9088d4049a65c3 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Fri, 22 Oct 2010 16:44:12 +0100 Subject: [PATCH] get_merge_bases() should return a list rather than set This is for cases where we need to use one of the elements of the list. Signed-off-by: Catalin Marinas --- stgit/commands/publish.py | 2 +- stgit/lib/git.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stgit/commands/publish.py b/stgit/commands/publish.py index 3aa83a2..6bd1c94 100644 --- a/stgit/commands/publish.py +++ b/stgit/commands/publish.py @@ -155,7 +155,7 @@ def func(parser, options, args): # check for rebased stack. In this case we emulate a merge with the stack # base by setting two parents. - merge_bases = repository.get_merge_bases(public_head, stack.base) + merge_bases = set(repository.get_merge_bases(public_head, stack.base)) if public_head in merge_bases: # fast-forward the public ref repository.refs.set(public_ref, stack.head, 'publish') diff --git a/stgit/lib/git.py b/stgit/lib/git.py index d60e1d2..3378728 100644 --- a/stgit/lib/git.py +++ b/stgit/lib/git.py @@ -653,7 +653,7 @@ class Repository(RunWithEnv): """Return a set of merge bases of two commits.""" sha1_list = self.run(['git', 'merge-base', '--all', commit1.sha1, commit2.sha1]).output_lines() - return set(self.get_commit(sha1) for sha1 in sha1_list) + return [self.get_commit(sha1) for sha1 in sha1_list] def describe(self, commit): """Use git describe --all on the given commit.""" return self.run(['git', 'describe', '--all', commit.sha1] -- 2.11.0