summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c3
-rwxr-xr-xt/t3430-rebase-merges.sh14
2 files changed, 16 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 8b7a77fe5e..f61ec58d1d 100644
--- a/refs.c
+++ b/refs.c
@@ -600,7 +600,8 @@ int dwim_log(const char *str, int len, struct object_id *oid, char **log)
static int is_per_worktree_ref(const char *refname)
{
return !strcmp(refname, "HEAD") ||
- starts_with(refname, "refs/bisect/");
+ starts_with(refname, "refs/bisect/") ||
+ starts_with(refname, "refs/rewritten/");
}
static int is_pseudoref_syntax(const char *refname)
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 5f0febb997..96853784ec 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -176,4 +176,18 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
EOF
'
+test_expect_success 'refs/rewritten/* is worktree-local' '
+ git worktree add wt &&
+ cat >wt/script-from-scratch <<-\EOF &&
+ label xyz
+ exec GIT_DIR=../.git git rev-parse --verify refs/rewritten/xyz >a || :
+ exec git rev-parse --verify refs/rewritten/xyz >b
+ EOF
+
+ test_config -C wt sequence.editor \""$PWD"/replace-editor.sh\" &&
+ git -C wt rebase -i HEAD &&
+ test_must_be_empty wt/a &&
+ test_cmp_rev HEAD "$(cat wt/b)"
+'
+
test_done