Guest User

post-commit

a guest
Oct 11th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. add_debug_patch='.add-debug.patch'
  4. del_debug_patch='.del-debug.patch'
  5. git_work_dir="$(git rev-parse --show-toplevel)"
  6. fake_file="$git_work_dir/.fake_file"
  7. cur_dir="$(pwd)"
  8.  
  9. function force_stash_pop {
  10. git diff --binary stash@{0} | patch --binary -R -s
  11. # for safety comment this line
  12. git stash drop -q
  13. }
  14.  
  15. if [ ! -e "$add_debug_patch" ]; then
  16. exit 0
  17. fi
  18.  
  19. cd $git_work_dir
  20. patch -s -p1 < $add_debug_patch
  21. rm $add_debug_patch
  22.  
  23. #echo "pop unstaged stash"
  24. force_stash_pop
  25.  
  26. cd - > /dev/null 2>&1
Add Comment
Please, Sign In to add comment