Skip to content

Commit 4353f38

Browse files
Fredrik KuivinenJunio C Hamano
authored andcommitted
merge-recursive: Improve the error message printed when merge(1) isn't found.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent d37fd03 commit 4353f38

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

git-merge-recursive.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,16 @@ def mergeFile(oPath, oSha, oMode, aPath, aSha, aMode, bPath, bSha, bMode,
205205
orig = runProgram(['git-unpack-file', oSha]).rstrip()
206206
src1 = runProgram(['git-unpack-file', aSha]).rstrip()
207207
src2 = runProgram(['git-unpack-file', bSha]).rstrip()
208-
[out, code] = runProgram(['merge',
209-
'-L', branch1Name + '/' + aPath,
210-
'-L', 'orig/' + oPath,
211-
'-L', branch2Name + '/' + bPath,
212-
src1, orig, src2], returnCode=True)
208+
try:
209+
[out, code] = runProgram(['merge',
210+
'-L', branch1Name + '/' + aPath,
211+
'-L', 'orig/' + oPath,
212+
'-L', branch2Name + '/' + bPath,
213+
src1, orig, src2], returnCode=True)
214+
except ProgramError, e:
215+
print >>sys.stderr, e
216+
die("Failed to execute 'merge'. merge(1) is used as the "
217+
"file-level merge tool. Is 'merge' in your path?")
213218

214219
sha = runProgram(['git-hash-object', '-t', 'blob', '-w',
215220
src1]).rstrip()

0 commit comments

Comments
 (0)