Add documentation for git-config-set
[git.git] / fetch-pack.c
index cb21715..6565982 100644 (file)
@@ -458,5 +458,19 @@ int main(int argc, char **argv)
        close(fd[0]);
        close(fd[1]);
        finish_connect(pid);
+
+       if (!ret && nr_heads) {
+               /* If the heads to pull were given, we should have
+                * consumed all of them by matching the remote.
+                * Otherwise, 'git-fetch remote no-such-ref' would
+                * silently succeed without issuing an error.
+                */
+               for (i = 0; i < nr_heads; i++)
+                       if (heads[i] && heads[i][0]) {
+                               error("no such remote ref %s", heads[i]);
+                               ret = 1;
+                       }
+       }
+
        return ret;
 }