git-submodule.sh: remove duplicate call to set_rev_name
set_rev_name is a possiblly expensive operation. If a submodule has changes in it, set_rev_name was called twice. Move call to set_rev_name so it's only called once, no matter which codepath is taken. Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
fb7dfaa710
commit
b545cd15af
@ -1129,16 +1129,16 @@ cmd_status()
|
|||||||
say "-$sha1 $displaypath"
|
say "-$sha1 $displaypath"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
set_name_rev "$sm_path" "$sha1"
|
|
||||||
if git diff-files --ignore-submodules=dirty --quiet -- "$sm_path"
|
if git diff-files --ignore-submodules=dirty --quiet -- "$sm_path"
|
||||||
then
|
then
|
||||||
|
set_name_rev "$sm_path" "$sha1"
|
||||||
say " $sha1 $displaypath$revname"
|
say " $sha1 $displaypath$revname"
|
||||||
else
|
else
|
||||||
if test -z "$cached"
|
if test -z "$cached"
|
||||||
then
|
then
|
||||||
sha1=$(clear_local_git_env; cd "$sm_path" && git rev-parse --verify HEAD)
|
sha1=$(clear_local_git_env; cd "$sm_path" && git rev-parse --verify HEAD)
|
||||||
set_name_rev "$sm_path" "$sha1"
|
|
||||||
fi
|
fi
|
||||||
|
set_name_rev "$sm_path" "$sha1"
|
||||||
say "+$sha1 $displaypath$revname"
|
say "+$sha1 $displaypath$revname"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user