Merge pull request #138 from mhagger/retain-more-authors

Retain author info whenever retaining commit message
This commit is contained in:
Michael Haggerty 2018-11-14 08:39:51 +01:00 committed by GitHub
commit 002b8bd9df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 3 deletions

View File

@ -2863,7 +2863,11 @@ class MergeState(Block):
self.git.get_log_message(orig).rstrip('\n')
+ '\n\n(rebased-with-history from commit %s)\n' % orig
)
commit = self.git.commit_tree(tree, [commit, orig], msg=msg)
commit = self.git.commit_tree(
tree, [commit, orig],
msg=msg,
metadata=self.git.get_author_info(orig),
)
self._set_refname(refname, commit, force=force)
@ -2909,7 +2913,11 @@ class MergeState(Block):
+ '\n\n(rebased from commit %s)\n' % (orig,)
)
commit = self.git.commit_tree(tree, parents, msg=msg)
commit = self.git.commit_tree(
tree, parents,
msg=msg,
metadata=self.git.get_author_info(orig),
)
commit1 = commit
i2 = self.len2 - 1
@ -2932,7 +2940,11 @@ class MergeState(Block):
+ '\n\n(rebased from commit %s)\n' % (orig,)
)
commit = self.git.commit_tree(tree, parents, msg=msg)
commit = self.git.commit_tree(
tree, parents,
msg=msg,
metadata=self.git.get_author_info(orig),
)
commit2 = commit
# Construct the apex commit:

View File

@ -4,6 +4,9 @@ set -e
DESCRIPTION="git-imerge test repository"
# Sleep between commits to give commits distinct timestamps:
SLEEP="sleep 1"
modify() {
filename="$1"
text="$2"
@ -36,12 +39,14 @@ git config user.email 'luser@example.com'
modify a.txt 0
git commit -m 'm⇒0'
$SLEEP
git checkout -b a --
for i in $(seq 8)
do
modify a.txt $i
git commit -m "a⇒$i"
$SLEEP
done
git checkout -b b master --
@ -49,6 +54,7 @@ for i in $(seq 5)
do
modify b.txt $i
git commit -m "b⇒$i"
$SLEEP
done
git checkout -b c master --
@ -56,13 +62,16 @@ for i in $(seq 3)
do
modify c.txt $i
git commit -m "c⇒$i"
$SLEEP
done
modify conflict.txt "c version"
git commit -m "c conflict"
$SLEEP
for i in $(seq 4 8)
do
modify c.txt $i
git commit -m "c⇒$i"
$SLEEP
done
git checkout -b d master --
@ -70,6 +79,7 @@ for i in $(seq 2)
do
modify d.txt $i
git commit -m "d⇒$i"
$SLEEP
done
modify conflict.txt "d version"
git commit -m "d conflict"
@ -77,6 +87,7 @@ for i in $(seq 3 5)
do
modify d.txt $i
git commit -m "d⇒$i"
$SLEEP
done
git checkout master --