Guest User

Untitled

a guest
Oct 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. def get_file_diff(commit1, commit2, folder):
  2. ls = run_cmd(['git', 'diff', '--name-status', commit1, commit2])
  3. lines = ls.split("\n")
  4.  
  5. ret = []
  6. idx = 0
  7. while idx < len(lines):
  8. line = lines[idx]
  9. if len(line.strip()) > 0:
  10. sl = line.split("\t")
  11. act = sl[0]
  12. file = sl[-1]
  13.  
  14. if act == "A" or act == "M":
  15. if file.startswith(folder):
  16. ret.append(file)
  17.  
  18. idx += 1
  19.  
  20. return ret
Add Comment
Please, Sign In to add comment