git-gui: Replace null_sha1 with nullid

Both $nullid and $null_sha1 point to the same content. Use only $nullid consistently. This is a preliminary cleanup for adding the support of SHA256 repo. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Takashi Iwai committed Jul 16, 2025 at 09:32 UTC 532a054451da6f433095405cb21b6e082a0a0a42
2 files changed +4 -5
git-gui.sh
+2 -3
@@ -1845,10 +1845,9 @@ proc short_path {path} {
1845 }
1846
1847 set next_icon_id 0
1848 -set null_sha1 [string repeat 0 40]
1848
1849 proc merge_state {path new_state {head_info {}} {index_info {}}} {
1851 - global file_states next_icon_id null_sha1
1850 + global file_states next_icon_id nullid
1851
1852 set s0 [string index $new_state 0]
1853 set s1 [string index $new_state 1]
@@ -1870,7 +1869,7 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
1869 elseif {$s1 eq {_}} {set s1 _}
1870
1871 if {$s0 eq {A} && $s1 eq {_} && $head_info eq {}} {
1873 - set head_info [list 0 $null_sha1]
1872 + set head_info [list 0 $nullid]
1873 } elseif {$s0 ne {_} && [string index $state 0] eq {_}
1874 && $head_info eq {}} {
1875 set head_info $index_info
lib/checkout_op.tcl
+2 -2
@@ -151,7 +151,7 @@ method _finish_fetch {ok} {
151 }
152
153 method _update_ref {} {
154 - global null_sha1 current_branch repo_config
154 + global nullid current_branch repo_config
155
156 set ref $new_ref
157 set new $new_hash
@@ -177,7 +177,7 @@ method _update_ref {} {
177 }
178
179 set reflog_msg "branch: Created from $new_expr"
180 - set cur $null_sha1
180 + set cur $nullid
181
182 if {($repo_config(branch.autosetupmerge) eq {true}
183 || $repo_config(branch.autosetupmerge) eq {always})