Skip to content

Commit 532a054

Browse files
tiwaij6t
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Sixt <[email protected]>
1 parent 3f07230 commit 532a054

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

git-gui.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,10 +1845,9 @@ proc short_path {path} {
18451845
}
18461846

18471847
set next_icon_id 0
1848-
set null_sha1 [string repeat 0 40]
18491848

18501849
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
18521851

18531852
set s0 [string index $new_state 0]
18541853
set s1 [string index $new_state 1]
@@ -1870,7 +1869,7 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
18701869
elseif {$s1 eq {_}} {set s1 _}
18711870

18721871
if {$s0 eq {A} && $s1 eq {_} && $head_info eq {}} {
1873-
set head_info [list 0 $null_sha1]
1872+
set head_info [list 0 $nullid]
18741873
} elseif {$s0 ne {_} && [string index $state 0] eq {_}
18751874
&& $head_info eq {}} {
18761875
set head_info $index_info

lib/checkout_op.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ method _finish_fetch {ok} {
151151
}
152152

153153
method _update_ref {} {
154-
global null_sha1 current_branch repo_config
154+
global nullid current_branch repo_config
155155

156156
set ref $new_ref
157157
set new $new_hash
@@ -177,7 +177,7 @@ method _update_ref {} {
177177
}
178178

179179
set reflog_msg "branch: Created from $new_expr"
180-
set cur $null_sha1
180+
set cur $nullid
181181

182182
if {($repo_config(branch.autosetupmerge) eq {true}
183183
|| $repo_config(branch.autosetupmerge) eq {always})

0 commit comments

Comments
 (0)