File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ copy_commit()
296296 # We're going to set some environment vars here, so
297297 # do it in a subshell to get rid of them safely later
298298 debug copy_commit " {$1 }" " {$2 }" " {$3 }"
299- git log -1 --pretty=format:' %an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b ' " $1 " |
299+ git log -1 --pretty=format:' %an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B ' " $1 " |
300300 (
301301 read GIT_AUTHOR_NAME
302302 read GIT_AUTHOR_EMAIL
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ test_expect_success 'add sub1' '
7474 git branch -m master subproj
7575'
7676
77+ # Save this hash for testing later.
78+
79+ subdir_hash=` git rev-parse HEAD`
80+
7781test_expect_success ' add sub2' '
7882 create sub2 &&
7983 git commit -m "sub2" &&
@@ -205,10 +209,21 @@ test_expect_success 'check if --message works for split+rejoin' '
205209'
206210
207211test_expect_success ' check split with --branch' '
208- spl1=$(git subtree split --annotate=' " '*'" ' --prefix subdir --onto FETCH_HEAD --message "Split & rejoin" --rejoin) &&
209- undo &&
210- git subtree split --annotate=' " '*'" ' --prefix subdir --onto FETCH_HEAD --branch splitbr1 &&
211- check_equal ' ' "$(git rev-parse splitbr1)"' ' "$spl1"
212+ spl1=$(git subtree split --annotate=' " '*'" ' --prefix subdir --onto FETCH_HEAD --message "Split & rejoin" --rejoin) &&
213+ undo &&
214+ git subtree split --annotate=' " '*'" ' --prefix subdir --onto FETCH_HEAD --branch splitbr1 &&
215+ check_equal ' ' "$(git rev-parse splitbr1)"' ' "$spl1"
216+ '
217+
218+ test_expect_success ' check hash of split' '
219+ spl1=$(git subtree split --prefix subdir) &&
220+ undo &&
221+ git subtree split --prefix subdir --branch splitbr1test &&
222+ check_equal ' ' "$(git rev-parse splitbr1test)"' ' "$spl1"
223+ git checkout splitbr1test &&
224+ new_hash=$(git rev-parse HEAD~2) &&
225+ git checkout mainline &&
226+ check_equal ' ' "$new_hash"' ' "$subdir_hash"
212227'
213228
214229test_expect_success ' check split with --branch for an existing branch' '
You can’t perform that action at this time.
0 commit comments