Skip to content

Commit

Permalink
Merge pull request #120 from mhagger/autofill-fix
Browse files Browse the repository at this point in the history
Fix `autofill` command
  • Loading branch information
mhagger committed Feb 10, 2017
2 parents a3bf755 + 3cbc1cf commit 5951fad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions git-imerge
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ class GitTemporaryHead(object):
"""

def __enter__(self, git, message):
def __init__(self, git, message):
self.git = git
self.message = message
self.head_name = git.get_head_refname()

def __enter__(self):
self.head_name = self.git.get_head_refname()
return self

def __exit__(self, exc_type, exc_val, exc_tb):
Expand Down
12 changes: 10 additions & 2 deletions t/test-conflicted
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ git checkout c
"$GIT_IMERGE" init --name=c-d d
"$GIT_IMERGE" list
"$GIT_IMERGE" diagram --commits --frontier --html=imerge0.html
"$GIT_IMERGE" autofill || true
"$GIT_IMERGE" autofill 2>&1 | tee autofill.out
if grep -q Traceback autofill.out
then
exit 1
fi
"$GIT_IMERGE" diagram --commits --frontier --html=imerge1.html
"$GIT_IMERGE" continue --edit
echo 'cd version' >conflict.txt
Expand All @@ -36,7 +40,11 @@ GIT_EDITOR=cat "$GIT_IMERGE" simplify --goal=merge --branch=c-d-merge
"$GIT_IMERGE" remove

git checkout c
"$GIT_IMERGE" start --goal=full --first-parent --name=c-d d || true
"$GIT_IMERGE" start --goal=full --first-parent --name=c-d d 2>&1 | tee start.out
if grep -q Traceback start.out
then
exit 1
fi
"$GIT_IMERGE" diagram --commits --frontier --html=imerge3.html
echo 'cd version' >conflict.txt
git add conflict.txt
Expand Down

0 comments on commit 5951fad

Please sign in to comment.