mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
Merge branch 'ps/reflog-migration-with-logall-fix'
The "git refs migrate" command did not migrate the reflog for refs/stash, which is the contents of the stashes, which has been corrected. * ps/reflog-migration-with-logall-fix: refs: fix migration of reflogs respecting "core.logAllRefUpdates"
This commit is contained in:
2
refs.c
2
refs.c
@@ -1330,7 +1330,7 @@ int ref_transaction_update_reflog(struct ref_transaction *transaction,
|
||||
|
||||
assert(err);
|
||||
|
||||
flags |= REF_LOG_ONLY | REF_NO_DEREF;
|
||||
flags |= REF_LOG_ONLY | REF_FORCE_CREATE_REFLOG | REF_NO_DEREF;
|
||||
|
||||
if (!transaction_refname_valid(refname, new_oid, flags, err))
|
||||
return -1;
|
||||
|
||||
@@ -224,6 +224,23 @@ do
|
||||
test_commit --date "100003000 +0700" --no-tag -C repo second &&
|
||||
test_migration repo "$to_format"
|
||||
'
|
||||
|
||||
test_expect_success "$from_format -> $to_format: stash is retained" '
|
||||
test_when_finished "rm -rf repo" &&
|
||||
git init --ref-format=$from_format repo &&
|
||||
(
|
||||
cd repo &&
|
||||
test_commit initial A &&
|
||||
echo foo >A &&
|
||||
git stash push &&
|
||||
echo bar >A &&
|
||||
git stash push &&
|
||||
git stash list >expect.reflog &&
|
||||
test_migration . "$to_format" &&
|
||||
git stash list >actual.reflog &&
|
||||
test_cmp expect.reflog actual.reflog
|
||||
)
|
||||
'
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user