This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import sys | |
def get_diff(): | |
base_commit = subprocess.run(['git', 'rev-parse', '--verify', 'HEAD'], stdout=subprocess.PIPE).stdout.decode('utf-8').strip() | |
return subprocess.run(['git', 'diff', '--cached', base_commit], stdout=subprocess.PIPE).stdout.decode('utf-8').strip() | |
def check_for_merge_markers(diff): |