Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-25 09:10:42 +0300
committerJunio C Hamano <gitster@pobox.com>2015-02-25 09:10:42 +0300
commit7bc4c01d9b66b4bc5ef1a7d77a6743ca135ea680 (patch)
tree65746441fe80c3b8ef7679392e1e59581ebdd37a
parent2764442ac9a66532789526a6e6aaf0f1254a3548 (diff)
parenta9c4641df7989c9adf6af471705ebf735c35a92f (diff)
Merge branch 'ak/add-i-empty-candidates' into maint
The interactive "show a list and let the user choose from it" interface "add -i" used showed and prompted to the user even when the candidate list was empty, against which the only "choice" the user could have made was to choose nothing. * ak/add-i-empty-candidates: add -i: return from list_and_choose if there is no candidate
-rwxr-xr-xgit-add--interactive.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index c7256741cc..77876d433a 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -515,6 +515,9 @@ sub error_msg {
sub list_and_choose {
my ($opts, @stuff) = @_;
my (@chosen, @return);
+ if (!@stuff) {
+ return @return;
+ }
my $i;
my @prefixes = find_unique_prefixes(@stuff) unless $opts->{LIST_ONLY};
@@ -725,6 +728,8 @@ sub add_untracked_cmd {
if (@add) {
system(qw(git update-index --add --), @add);
say_n_paths('added', @add);
+ } else {
+ print "No untracked files.\n";
}
print "\n";
}