diff options
author | Fredrik Gustafsson <iveqy@iveqy.com> | 2013-06-17 11:55:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-17 13:26:42 -0700 |
commit | b545cd15af873fe15e692daaa6e804b191b451cc (patch) | |
tree | 9c2ea540b98e341a606f44879bf54152b58a710b /git-submodule.sh | |
parent | fb7dfaa710da6f9ebb854f70ffc1c78668a1e70c (diff) | |
download | git-b545cd15af873fe15e692daaa6e804b191b451cc.tar.gz |
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>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-x | git-submodule.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 79bfaac9d4..75feaf1749 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1129,16 +1129,16 @@ cmd_status() say "-$sha1 $displaypath" continue; fi - set_name_rev "$sm_path" "$sha1" if git diff-files --ignore-submodules=dirty --quiet -- "$sm_path" then + set_name_rev "$sm_path" "$sha1" say " $sha1 $displaypath$revname" else if test -z "$cached" then sha1=$(clear_local_git_env; cd "$sm_path" && git rev-parse --verify HEAD) - set_name_rev "$sm_path" "$sha1" fi + set_name_rev "$sm_path" "$sha1" say "+$sha1 $displaypath$revname" fi |