Guest User

Git subtree pull fatal error reproduce

a guest
Mar 8th, 2012
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo ''
  4. echo '-- Create the library repository.'
  5. echo ''
  6.  
  7. mkdir repoLib
  8. cd repoLib
  9. git init
  10. echo test > test.txt
  11. git add .
  12. git commit -m 'Adding test.txt'
  13. cd ..
  14.  
  15. echo ''
  16. echo '-- Create a bare repository that we can push into (emulating what we are doing in gitolite).'
  17. echo ''
  18.  
  19. mkdir repoMain_Server
  20. cd repoMain_Server
  21. git init --bare
  22. cd ..
  23.  
  24. echo ''
  25. echo '-- Clone the server repository.'
  26. echo ''
  27.  
  28. git clone repoMain_Server repoMain
  29. cd repoMain
  30.  
  31. echo ''
  32. echo '-- Write a file and push to the server repo.'
  33. echo ''
  34.  
  35. echo test > test2.txt
  36. git add .
  37. git commit -m 'Adding test2.txt'
  38. git push origin master
  39.  
  40. echo ''
  41. echo '-- subtree add the library repository and push the results to the server.  If --squash is removed everything will work.'
  42. echo ''
  43.  
  44. git subtree add -P Subtree/librepoLib --squash ../repoLib master
  45. git push origin master
  46. cd ..
  47.  
  48. echo ''
  49. echo '-- clone the main repo and attempt to split out Subtree/librepoLib, should succeed'
  50. echo ''
  51.  
  52. git clone repoMain repoMainClone
  53. cd repoMainClone
  54. git subtree split -P Subtree/librepoLib -b libABranch
  55. cd ..
  56.  
  57. echo ''
  58. echo '-- pull the main repo and attempt to split out Subtree/librepoLib, should error (fatal: bad object ...)'
  59. echo ''
  60.  
  61. mkdir repoMainPull
  62. cd repoMainPull
  63. git init
  64. git pull ../repoMain
  65. git subtree split -P Subtree/librepoLib -b libABranch
  66. cd ..
  67.  
  68. echo ''
  69. echo '-- clone the server repository as if we were a separate user on a separate computer.'
  70. echo '-- attempt to split out Subtree/librepoLib, should error (fatal: bad object ...)'
  71. echo ''
  72.  
  73. git clone repoMain_Server repoMain_ServerWorking
  74. cd repoMain_ServerWorking
  75. git subtree split -P Subtree/librepoLib -b libABranch
Advertisement
Add Comment
Please, Sign In to add comment