From 40bd629038e0166f931c4e39b1ee5511d6dc18c1 Mon Sep 17 00:00:00 2001 Message-Id: <40bd629038e0166f931c4e39b1ee5511d6dc18c1.1746782688.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 19 Dec 2007 18:00:15 +0000 Subject: [PATCH] Don't assume there is always a stage 2 in git.get_conflicts Organization: Straylight/Edgeware From: Catalin Marinas For example, the t1202-push-undo.sh test generates a conflict where a file was added in both current and patch but different content and missing in ancestor, therefore no stage 2. There could also be a case where stage 3 is missing if a file is removed by the patch being pushed. Signed-off-by: Catalin Marinas --- stgit/git.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stgit/git.py b/stgit/git.py index 0cfcd42..01076c9 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -153,14 +153,12 @@ def get_commit(id_hash): def get_conflicts(): """Return the list of file conflicts """ - names = [] + names = set() for line in GRun('ls-files', '-z', '--unmerged' ).raw_output().split('\0')[:-1]: stat, path = line.split('\t', 1) - # Look for entries in stage 2 (could equally well use 3) - if stat.endswith(' 2'): - names.append(path) - return names + names.add(path) + return list(names) def exclude_files(): files = [os.path.join(basedir.get(), 'info', 'exclude')] -- [mdw]