Skip to content

Commit 95dd4b2

Browse files
committed
Merge branch 'js/rebase-recreate-merge'
Hotfixes. * js/rebase-recreate-merge: sequencer: ensure labels that are object IDs are rewritten git-rebase--interactive: fix copy-paste mistake
2 parents cbb408e + 5971b08 commit 95dd4b2

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ r, reword <commit> = use commit, but edit the commit message
162162
e, edit <commit> = use commit, but stop for amending
163163
s, squash <commit> = use commit, but meld into previous commit
164164
f, fixup <commit> = like \"squash\", but discard this commit's log message
165-
x, exec <commit> = run command (the rest of the line) using shell
165+
x, exec <command> = run command (the rest of the line) using shell
166166
d, drop <commit> = remove commit
167167
l, label <label> = label current HEAD with a name
168168
t, reset <label> = reset HEAD to a label

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
37923792
p[i] = save;
37933793
}
37943794
}
3795-
} else if (((len = strlen(label)) == GIT_SHA1_RAWSZ &&
3795+
} else if (((len = strlen(label)) == the_hash_algo->hexsz &&
37963796
!get_oid_hex(label, &dummy)) ||
37973797
(len == 1 && *label == '#') ||
37983798
hashmap_get_from_hash(&state->labels,

t/t3430-rebase-merges.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ test_expect_success 'create completely different structure' '
7070
merge -C H second
7171
merge onebranch # Merge the topic branch '\''onebranch'\''
7272
EOF
73+
cp script-from-scratch script-from-scratch-orig &&
7374
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
7475
test_tick &&
7576
git rebase -i -r A &&
@@ -313,4 +314,20 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
313314
EOF
314315
'
315316

317+
test_expect_success 'labels that are object IDs are rewritten' '
318+
git checkout -b third B &&
319+
test_tick &&
320+
test_commit I &&
321+
third=$(git rev-parse HEAD) &&
322+
git checkout -b labels master &&
323+
git merge --no-commit third &&
324+
test_tick &&
325+
git commit -m "Merge commit '\''$third'\'' into labels" &&
326+
cp script-from-scratch-orig script-from-scratch &&
327+
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
328+
test_tick &&
329+
git rebase -i -r A &&
330+
! grep "^label $third$" .git/ORIGINAL-TODO
331+
'
332+
316333
test_done

0 commit comments

Comments
 (0)