Skip to content

Commit d27107e

Browse files
committed
Fix remove-worktree, remove unused parameters
1 parent db33051 commit d27107e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/git-subrepo

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ subrepo:branch() {
787787
o "No parent setting, use the subdir content."
788788
RUN git branch "$branch" HEAD
789789
TTY=true FAIL=false RUN git filter-branch -f --subdirectory-filter \
790-
"$subdir" "$branch"
790+
"$subref" "$branch"
791791
fi
792792

793793
o "Remove the .gitrepo file from $first_gitrepo_commit..$branch"
@@ -857,7 +857,7 @@ subrepo:commit() {
857857
fi
858858

859859
# Clean up worktree to indicate that we are ready
860-
git:remove-worktree "$branch_name"
860+
git:remove-worktree
861861

862862
o "Create ref '$refs_subrepo_commit'."
863863
git:make-ref "$refs_subrepo_commit" "$subrepo_commit_ref"
@@ -945,11 +945,12 @@ subrepo:status() {
945945

946946
subrepo:clean() {
947947
# Remove subrepo branches if exist:
948-
local branch="subrepo/$subdir"
948+
local branch="subrepo/$subref"
949949
local ref="refs/heads/$branch"
950+
local worktree="$GIT_TMP/$branch"
950951

951952
o "Clean $subdir"
952-
git:remove-worktree "$branch"
953+
git:remove-worktree
953954
if [[ -e .git/$ref ]]; then
954955
o "Remove branch '$branch'."
955956
RUN git update-ref -d "$ref"
@@ -1750,6 +1751,7 @@ git:create-worktree() {
17501751
}
17511752

17521753
git:remove-worktree() {
1754+
o "Remove $worktree"
17531755
if [[ -d "$worktree" ]]; then
17541756
o "Check worktree for unsaved changes"
17551757
cd "$worktree"
@@ -1766,7 +1768,7 @@ git:delete-branch() {
17661768
local branch="$1"
17671769
o "Deleting old '$branch_name' branch."
17681770
# Remove worktree first, otherwise you can't delete the branch
1769-
git:remove-worktree "$branch"
1771+
git:remove-worktree
17701772
FAIL=false RUN git branch -D "$branch"
17711773
}
17721774

test/pull-merge.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ is "$(cat $OWNER/foo/bar/Bar2)" \
7979
}
8080

8181
(
82-
set -x
8382
cd $OWNER/foo
8483
git subrepo push bar
8584
) &> /dev/null || die

0 commit comments

Comments
 (0)