diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-06-17 21:54:02 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-06-17 21:54:02 -0700 |
| commit | a554228ffb417b75c4ab586f084079ac98665c1a (patch) | |
| tree | d7a60ea07d487d719e74dc50f613cd17853ae8fc /builtin | |
| parent | Merge branch 'js/reflog-anonymize-for-clone-and-fetch' (diff) | |
| parent | sparse-checkout: avoid staging deletions of all files (diff) | |
| download | git-a554228ffb417b75c4ab586f084079ac98665c1a.tar.gz git-a554228ffb417b75c4ab586f084079ac98665c1a.zip | |
Merge branch 'en/sparse-checkout'
The behaviour of "sparse-checkout" in the state "git clone
--no-checkout" left was changed accidentally in 2.27, which has
been corrected.
* en/sparse-checkout:
sparse-checkout: avoid staging deletions of all files
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/sparse-checkout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 95d0882417..595463be68 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -99,6 +99,10 @@ static int update_working_directory(struct pattern_list *pl) struct lock_file lock_file = LOCK_INIT; struct repository *r = the_repository; + /* If no branch has been checked out, there are no updates to make. */ + if (is_index_unborn(r->index)) + return UPDATE_SPARSITY_SUCCESS; + memset(&o, 0, sizeof(o)); o.verbose_update = isatty(2); o.update = 1; |
