return 1
orig_git_user_email = out.strip()
- # masquerade user name/ email
- gitcmd = "git config user.name \"%s\"" % (event['tagger_username'])
- if runner.show(gitcmd)[0] != 0:
- raise Exception("failed to execute %s" % gitcmd)
-
- gitcmd = "git config user.email \"%s\"" % (event['tagger_useremail'])
- if runner.show(gitcmd)[0] != 0:
- raise Exception("failed to execute %s" % gitcmd)
-
os.environ["GIT_AUTHOR_EMAIL"] = event['tagger_useremail']
os.environ["GIT_AUTHOR_NAME"] = event['tagger_username']
mygit = Git(prjdir)
+ cur_dir = os.getcwd()
+ os.chdir(prjdir)
+ # masquerade user name/ email
+ gitcmd = "git config user.name \"%s\"" % (event['tagger_username'])
+ if runner.show(gitcmd)[0] != 0:
+ raise Exception("failed to execute %s" % gitcmd)
+ gitcmd = "git config user.email \"%s\"" % (event['tagger_useremail'])
+ if runner.show(gitcmd)[0] != 0:
+ raise Exception("failed to execute %s" % gitcmd)
+ os.chdir(cur_dir)
+
branches = mygit.branch_contains(commit)
if event['branch'] not in branches:
raise LocalError("commit %s is not in branch %s" % (commit, event['branch']))