Merge branch 'js/rebase-recreate-merge'
authorJunio C Hamano <gitster@pobox.com>
Fri, 1 Jun 2018 06:06:40 +0000 (15:06 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jun 2018 06:06:40 +0000 (15:06 +0900)
Hotfixes.

* js/rebase-recreate-merge:
sequencer: ensure labels that are object IDs are rewritten
git-rebase--interactive: fix copy-paste mistake

git-rebase--interactive.sh
sequencer.c
t/t3430-rebase-merges.sh
index 0c92ac00fa3a86c283ae52bae5f409ddc05e66e7..06a7b793075d7701b5dafa69b3576d13ba7c9de6 100644 (file)
@@ -162,7 +162,7 @@ r, reword <commit> = use commit, but edit the commit message
 e, edit <commit> = use commit, but stop for amending
 s, squash <commit> = use commit, but meld into previous commit
 f, fixup <commit> = like \"squash\", but discard this commit's log message
-x, exec <commit> = run command (the rest of the line) using shell
+x, exec <command> = run command (the rest of the line) using shell
 d, drop <commit> = remove commit
 l, label <label> = label current HEAD with a name
 t, reset <label> = reset HEAD to a label
index 560fc9b67d480069328d379421c606d800e82135..cca968043ea86c4515e6af1b4fe9251a0140c0a3 100644 (file)
@@ -3792,7 +3792,7 @@ static const char *label_oid(struct object_id *oid, const char *label,
                                p[i] = save;
                        }
                }
-       } else if (((len = strlen(label)) == GIT_SHA1_RAWSZ &&
+       } else if (((len = strlen(label)) == the_hash_algo->hexsz &&
                    !get_oid_hex(label, &dummy)) ||
                   (len == 1 && *label == '#') ||
                   hashmap_get_from_hash(&state->labels,
index ce6de6f491e5a6bf5f1d767e14af2b19c467330b..2608e5483d5268f4b84f726b7b2d54961ee76a27 100755 (executable)
@@ -70,6 +70,7 @@ test_expect_success 'create completely different structure' '
        merge -C H second
        merge onebranch # Merge the topic branch '\''onebranch'\''
        EOF
+       cp script-from-scratch script-from-scratch-orig &&
        test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
        test_tick &&
        git rebase -i -r A &&
@@ -313,4 +314,20 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
        EOF
 '
 
+test_expect_success 'labels that are object IDs are rewritten' '
+       git checkout -b third B &&
+       test_tick &&
+       test_commit I &&
+       third=$(git rev-parse HEAD) &&
+       git checkout -b labels master &&
+       git merge --no-commit third &&
+       test_tick &&
+       git commit -m "Merge commit '\''$third'\'' into labels" &&
+       cp script-from-scratch-orig script-from-scratch &&
+       test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
+       test_tick &&
+       git rebase -i -r A &&
+       ! grep "^label $third$" .git/ORIGINAL-TODO
+'
+
 test_done