Skip to content

Commit 5951fad

Browse files
authored
Merge pull request #120 from mhagger/autofill-fix
Fix `autofill` command
2 parents a3bf755 + 3cbc1cf commit 5951fad

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

git-imerge

+4-2
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,12 @@ class GitTemporaryHead(object):
309309
310310
"""
311311

312-
def __enter__(self, git, message):
312+
def __init__(self, git, message):
313313
self.git = git
314314
self.message = message
315-
self.head_name = git.get_head_refname()
315+
316+
def __enter__(self):
317+
self.head_name = self.git.get_head_refname()
316318
return self
317319

318320
def __exit__(self, exc_type, exc_val, exc_tb):

t/test-conflicted

+10-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ git checkout c
2323
"$GIT_IMERGE" init --name=c-d d
2424
"$GIT_IMERGE" list
2525
"$GIT_IMERGE" diagram --commits --frontier --html=imerge0.html
26-
"$GIT_IMERGE" autofill || true
26+
"$GIT_IMERGE" autofill 2>&1 | tee autofill.out
27+
if grep -q Traceback autofill.out
28+
then
29+
exit 1
30+
fi
2731
"$GIT_IMERGE" diagram --commits --frontier --html=imerge1.html
2832
"$GIT_IMERGE" continue --edit
2933
echo 'cd version' >conflict.txt
@@ -36,7 +40,11 @@ GIT_EDITOR=cat "$GIT_IMERGE" simplify --goal=merge --branch=c-d-merge
3640
"$GIT_IMERGE" remove
3741

3842
git checkout c
39-
"$GIT_IMERGE" start --goal=full --first-parent --name=c-d d || true
43+
"$GIT_IMERGE" start --goal=full --first-parent --name=c-d d 2>&1 | tee start.out
44+
if grep -q Traceback start.out
45+
then
46+
exit 1
47+
fi
4048
"$GIT_IMERGE" diagram --commits --frontier --html=imerge3.html
4149
echo 'cd version' >conflict.txt
4250
git add conflict.txt

0 commit comments

Comments
 (0)