Skip to content

Commit 2c14be6

Browse files
committed
Pull didn't fail on history disconnect
set +o pipefail caused git to merge two branches without a common history instead of failing.
1 parent e515007 commit 2c14be6

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

lib/git-subrepo

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,9 +1787,7 @@ git:get-head-branch-commit() {
17871787
git:commit-in-rev-list() {
17881788
local commit=$1
17891789
local list_head=$2
1790-
set +o pipefail
17911790
git rev-list "$list_head" | grep -q "^$commit"
1792-
set -o pipefail
17931791
}
17941792

17951793
git:make-ref() {

test/pull.t

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ gitrepo=$OWNER/foo/bar/.gitrepo
8888
git subrepo pull bar || touch pull_failed
8989
) &> /dev/null || die
9090

91-
# XXX
92-
# # We check that the control file was created
93-
# {
94-
# test-exists \
95-
# "$OWNER/foo/pull_failed"
96-
# }
91+
# We check that the control file was created
92+
{
93+
test-exists \
94+
"$OWNER/foo/pull_failed"
95+
}
9796

9897
done_testing # 9
9998

0 commit comments

Comments
 (0)