diff options
| author | Junio C Hamano <junkio@cox.net> | 2007-02-24 02:20:13 -0800 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2007-02-24 02:20:13 -0800 |
| commit | efdfd6c8d418a2c12f31cacb50fa8a91b2b868c8 (patch) | |
| tree | 93a5eea7b3887a2a58583bf249f1d556019ba418 /git-commit.sh | |
| parent | d516c2d11945cf13ed3d961fa63817c60b7a566b (diff) | |
| parent | b4e1e4a787d3771f617182b3344dcdd9224bd0cb (diff) | |
| download | git-efdfd6c8d418a2c12f31cacb50fa8a91b2b868c8.tar.gz | |
Evil Merge branch 'jc/status' (early part) into js/diff-ni
* 'jc/status' (early part):
run_diff_{files,index}(): update calling convention.
update-index: do not die too early in a read-only repository.
git-status: do not be totally useless in a read-only repository.
This is to resolve semantic conflict (which is not textual) that
changes the calling convention of run_diff_files() early.
Diffstat (limited to 'git-commit.sh')
| -rwxr-xr-x | git-commit.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/git-commit.sh b/git-commit.sh index ec506d956f..cfa15110f6 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -13,10 +13,10 @@ git-rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t case "$0" in *status) status_only=t - unmerged_ok_if_status=--unmerged ;; + ;; *commit) status_only= - unmerged_ok_if_status= ;; + ;; esac refuse_partial () { @@ -389,16 +389,17 @@ else USE_INDEX="$THIS_INDEX" fi -GIT_INDEX_FILE="$USE_INDEX" \ - git-update-index -q $unmerged_ok_if_status --refresh || exit - -################################################################ -# If the request is status, just show it and exit. - -case "$0" in -*status) +case "$status_only" in +t) + # This will silently fail in a read-only repository, which is + # what we want. + GIT_INDEX_FILE="$USE_INDEX" git-update-index -q --unmerged --refresh run_status exit $? + ;; +'') + GIT_INDEX_FILE="$USE_INDEX" git-update-index -q --refresh || exit + ;; esac ################################################################ |
