Skip to content

Commit 46de788

Browse files
Fix bug in merge subcommand
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent b97598c commit 46de788

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git_sim/merge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def check_merge_conflict(self, branch1, branch2):
156156
repo_name = os.path.basename(self.repo.working_dir)
157157
new_dir = os.path.join(tempfile.gettempdir(), "git_sim", repo_name)
158158

159+
orig_repo = self.repo
159160
orig_remotes = self.repo.remotes
160161
self.repo = git.Repo.clone_from(git_root, new_dir, no_hardlinks=True)
161162
self.repo.git.checkout(branch2)
@@ -171,6 +172,7 @@ def check_merge_conflict(self, branch1, branch2):
171172
if len(entry) == 2 and entry[1] > 0:
172173
self.conflicted_files.append(entry[0])
173174
return 1, new_dir
175+
self.repo = orig_repo
174176
return 0, new_dir
175177

176178
# Override to display conflicted filenames

0 commit comments

Comments
 (0)