Closed linjer closed 4 years ago
Do you use Delete source branch after merging
option when merging branch in the pull request? If so, it's not surprising that you'll see that source branch will got deleted (00..00
hash means ref deletion in git).
My co-worker did it and I believe we observed it (00..00 hash) on 3 occasions, and he did use the delete source branch after merging PR on at least 1. The other 2 I do not think so.
In sourcetree, when I look at the history, they all have parent hashes that are not 00..00 but I do observe some have 2 hash parents (for merge).
Also observed 00..00 on to-ref hash after branching. That doesn't include any deletion.
All ref changes are passed from Stash as is without any modification logic (https://github.com/ngsru/atlassian-external-hooks/blob/master/src/main/java/com/ngs/stash/externalhooks/hook/ExternalPreReceiveHook.java#L99).
So, on my opinion, you've just misinterpret passed values. Seeing zeros in to_rev
field means that specified ref gets deleted; you can check it out by cloning repo to the clean directory and search for that ref in git show-ref
output.
However, if you have reproduceable test case, please let me know.
During a merge into the master branch the parameters from the external hook plugin to the external bash script were:
e5e98e5cb9f6c9dd4a12bb47de36c0283899236c 0000000000000000000000000000000000000000 refs/heads/user-dash
When a new branch was made locally, and committed, the parameters passed to the script were:
0000000000000000000000000000000000000000 f18cb17e1c0e31b52f5f8cd118e903e272f8af26 refs/heads/dashboards_dev
This caused trouble in the
git log
command used in the script (00... invalid commit).Environment
Stash 3.2.0 External Hooks 2.0-1 CentOS 6.5 git 2.1.0-rc0