diff --git a/pagure/hooks/files/fedmsg_hook.py b/pagure/hooks/files/fedmsg_hook.py index f6c2e6a..f363c4f 100755 --- a/pagure/hooks/files/fedmsg_hook.py +++ b/pagure/hooks/files/fedmsg_hook.py @@ -58,8 +58,8 @@ for line in sys.stdin.readlines(): authors = set() for rev in revs: - email = pagure.lib.git.get_pusher_email(rev, abspath) - name = pagure.lib.git.get_pusher(rev, abspath) + email = pagure.lib.git.get_author_email(rev, abspath) + name = pagure.lib.git.get_author(rev, abspath) author = search_user(pagure.SESSION, email=email) or name authors.add(author) diff --git a/pagure/hooks/files/pagure_hook.py b/pagure/hooks/files/pagure_hook.py index d0cb008..d9d635e 100755 --- a/pagure/hooks/files/pagure_hook.py +++ b/pagure/hooks/files/pagure_hook.py @@ -74,7 +74,7 @@ def relates_commit(commitid, issue, app_url=None): pagure.SESSION, issue=issue, comment=comment, - user=pagure.lib.git.get_pusher_email(commitid, abspath), + user=pagure.lib.git.get_author_email(commitid, abspath), ticketfolder=pagure.APP.config['TICKETS_FOLDER'], ) pagure.SESSION.commit() @@ -107,7 +107,7 @@ def fixes_relation(commitid, relation, app_url=None): pagure.SESSION, issue=relation, comment=comment, - user=pagure.lib.git.get_pusher_email(commitid, abspath), + user=pagure.lib.git.get_author_email(commitid, abspath), ticketfolder=pagure.APP.config['TICKETS_FOLDER'], ) elif relation.isa == 'pull-request': @@ -119,7 +119,7 @@ def fixes_relation(commitid, relation, app_url=None): filename=None, row=None, comment=comment, - user=pagure.lib.git.get_pusher_email(commitid, abspath), + user=pagure.lib.git.get_author_email(commitid, abspath), requestfolder=pagure.APP.config['REQUESTS_FOLDER'], ) pagure.SESSION.commit() @@ -142,14 +142,14 @@ def fixes_relation(commitid, relation, app_url=None): pagure.SESSION, relation, ticketfolder=pagure.APP.config['TICKETS_FOLDER'], - user=pagure.lib.git.get_pusher_email(commitid, abspath), + user=pagure.lib.git.get_author_email(commitid, abspath), status='Fixed') elif relation.isa == 'pull-request': pagure.lib.close_pull_request( pagure.SESSION, relation, requestfolder=pagure.APP.config['REQUESTS_FOLDER'], - user=pagure.lib.git.get_pusher_email(commitid, abspath), + user=pagure.lib.git.get_author_email(commitid, abspath), merged=True) pagure.SESSION.commit() except pagure.exceptions.PagureException as err: diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 3926213..95691e0 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -887,16 +887,16 @@ def get_default_branch(abspath): return 'master' -def get_pusher(commit, abspath): - ''' Return the name of the person that pushed the commit. ''' +def get_author(commit, abspath): + ''' Return the name of the person that authored the commit. ''' user = pagure.lib.git.read_git_lines( ['log', '-1', '--pretty=format:"%an"', commit], abspath)[0].replace('"', '') return user -def get_pusher_email(commit, abspath): - ''' Return the email of the person that pushed the commit. ''' +def get_author_email(commit, abspath): + ''' Return the email of the person that authored the commit. ''' user = pagure.lib.git.read_git_lines( ['log', '-1', '--pretty=format:"%ae"', commit], abspath)[0].replace('"', '')