The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Why server side update hook does not fire when creating branch in stash

Klaus Seiler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2015

Im writing update hook which should be invoked when a new branch is created. The hook is invoked when the branch is created localy and then pushed to stash but not wen the branch is created through Stash gui. Why?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2015

Git pre-receive-hook and post-receive-hooks are only triggered when you push changes to a repository, not when a branch or tag is created/updated or deleted locally. When you create a branch through the UI, the branch is created in the repository and no push is involved.

You could also listen for the BranchCreatedEvent or its supertype RepositoryRefsChangedEvent to get a callback whenever one or more refs are updated. Note that your event listener will receive these events for all repositories, so you might need to verify that your functionality should be enabled for the repository in question.

Relevant links: 

Klaus Seiler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2015

Thanks a lot! That was really fast answer!

0 votes
Gabby Romano
March 3, 2015

I guess it is because it doesn't go through the same flow as a create branch commit goes through. you will probably need an asynchronous hook in order for it to work. 

 

TAGS
AUG Leaders

Atlassian Community Events