Skip to content

Commit 00ee1bb

Browse files
authored
Merge pull request #114 from NikolasOliveira/clean-exit
Exit cleanly from 'git webdiff'
2 parents 62606f2 + d879c63 commit 00ee1bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

webdiff/gitwebdiff.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def run():
1717
# "git webdiff <sha>". This allows special treatment (e.g. for
1818
# staging diffhunks).
1919
os.environ['WEBDIFF_FROM_HEAD'] = 'yes'
20-
21-
sys.exit(subprocess.call(
22-
'git difftool -d -x webdiff'.split(' ') + sys.argv[1:]))
20+
21+
try:
22+
subprocess.call('git difftool -d -x webdiff'.split(' ') + sys.argv[1:])
23+
except KeyboardInterrupt:
24+
# Don't raise an exception to the user when sigint is received
25+
pass
2326

2427

2528
if __name__ == '__main__':

0 commit comments

Comments
 (0)