Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_file_diff(commit1, commit2, folder):
- ls = run_cmd(['git', 'diff', '--name-status', commit1, commit2])
- lines = ls.split("\n")
- ret = []
- idx = 0
- while idx < len(lines):
- line = lines[idx]
- if len(line.strip()) > 0:
- sl = line.split("\t")
- act = sl[0]
- file = sl[-1]
- if act == "A" or act == "M":
- if file.startswith(folder):
- ret.append(file)
- idx += 1
- return ret
Add Comment
Please, Sign In to add comment