git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 3/3] update-ref: add test cases for bare repository

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 26, 2017, 23:41 UTC
Message-ID
<xmqqmved1j98.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170126223159.16439-3-cornelius.weig@tngtech.com>
cornelius.weig@tngtech.com writes:
Show 35 quoted lines
> From: Cornelius Weig <cornelius.weig@tngtech.com>
>
> The default behavior of update-ref to create reflogs differs in
> repositories with worktree and bare ones. The existing tests cover only
> the behavior of repositories with worktree.
>
> This commit adds tests that assert the correct behavior in bare
> repositories for update-ref. Two cases are covered:
>
>  - If core.logAllRefUpdates is not set, no reflogs should be created
>  - If core.logAllRefUpdates is true, reflogs should be created
>
> Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
> ---
>  t/t1400-update-ref.sh | 43 ++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 36 insertions(+), 7 deletions(-)
>
> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
> index b9084ca..bad88c8 100755
> --- a/t/t1400-update-ref.sh
> +++ b/t/t1400-update-ref.sh
> @@ -8,23 +8,33 @@ test_description='Test git update-ref and basic ref logging'
>  
>  Z=$_z40
>  
> -test_expect_success setup '
> +m=refs/heads/master
> +n_dir=refs/heads/gu
> +n=$n_dir/fixes
> +outside=refs/foo
> +bare=bare-repo
>  
> +create_test_objects ()
> +{
> +	local T, sha1, prfx="$1"

CodingGuidelines. Do not use bash-ism "local" (besides, I do not think you want to have comma here).

Show 9 quoted lines
>  	for name in A B C D E F
>  	do
>  		test_tick &&
>  		T=$(git write-tree) &&
>  		sha1=$(echo $name | git commit-tree $T) &&
> -		eval $name=$sha1
> +		eval $prfx$name=$sha1
>  	done
> +}
Previous: cornelius.weig@tngtech.comNext: Junio C Hamano
Message 19 of 33 in “tag: add tag.createReflog option”
  1. tag: add tag.createReflog optioncornelius.weig@tngtech.com, Jan 25, 2017
  2. Pranit BauvaJan 25, 2017
  3. Jeff KingJan 25, 2017
  4. Junio C HamanoJan 25, 2017
  5. Cornelius WeigJan 25, 2017
  6. Jeff KingJan 25, 2017
  7. Junio C HamanoJan 25, 2017
  8. Junio C HamanoJan 25, 2017
  9. Cornelius WeigJan 25, 2017
  10. refs: add option core.logAllRefUpdates = alwayscornelius.weig@tngtech.com, Jan 26, 2017
  11. refs: add option core.logAllRefUpdates = alwayscornelius.weig@tngtech.com, Jan 26, 2017
  12. Jeff KingJan 26, 2017
  13. Cornelius WeigJan 26, 2017
  14. Jeff KingJan 26, 2017
  15. 1/3 config: add markup to core.logAllRefUpdates doccornelius.weig@tngtech.com, Jan 26, 2017
  16. 2/3 refs: add option core.logAllRefUpdates = alwayscornelius.weig@tngtech.com, Jan 26, 2017
  17. Junio C HamanoJan 26, 2017
  18. 3/3 update-ref: add test cases for bare repositorycornelius.weig@tngtech.com, Jan 26, 2017
  19. Junio C HamanoJan 26, 2017
  20. Junio C HamanoJan 26, 2017
  21. 1/3 config: add markup to core.logAllRefUpdates doccornelius.weig@tngtech.com, Jan 27, 2017
  22. 3/3 update-ref: add test cases for bare repositorycornelius.weig@tngtech.com, Jan 27, 2017
  23. 2/3 refs: add option core.logAllRefUpdates = alwayscornelius.weig@tngtech.com, Jan 27, 2017
  24. Junio C HamanoJan 30, 2017
  25. Junio C HamanoJan 30, 2017
  26. Cornelius WeigJan 31, 2017
  27. Junio C HamanoJan 31, 2017
  28. Jeff KingJan 30, 2017
  29. Cornelius WeigJan 31, 2017
  30. Jeff KingJan 31, 2017
  31. Junio C HamanoJan 31, 2017
  32. Cornelius WeigJan 31, 2017
  33. Junio C HamanoJan 31, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.