Не удалось отправить коммиты из подмодуля git?

У меня есть простой проект с одним подмодулем.

$ git submodule
 964737623a362f6303e87ec41f2c7090c8c2c093 lib/mongodb-php-odm (heads/master-1-g9647376)

Я сделал. вносит изменения в этот подмодуль и фиксирует их, но не может отправить их в github.

$ cd lib/mongodb-php-odm
$ git branch
* (no branch)
  master
$ git remote -v
origin  git@github.com:colinmollenhour/mongodb-php-odm.git
$ git ls-remote .
964737623a362f6303e87ec41f2c7090c8c2c093    HEAD
6f5f91eff9b1854faa30608f335aee92aa7532eb    refs/heads/master
6f5f91eff9b1854faa30608f335aee92aa7532eb    refs/remotes/origin/HEAD
6f5f91eff9b1854faa30608f335aee92aa7532eb    refs/remotes/origin/master
$ git push origin master
Everything up-to-date

Я не понимаю, почему там написано «Все актуально», потому что фиксация 964737 не была отправлена ​​на github. Скорее всего, я сделал что-то не так, но я понятия не имею, что это будет ... BufferedReader ir = новый BufferedReader (isr); Строка строки; while ((line = ir.readLine()) != null) { //do ...

I have this code in Java:

InputStreamReader isr = new InputStreamReader(getInputStream());
BufferedReader ir = new BufferedReader(isr);
String line;
while ((line = ir.readLine()) != null) {
 //do stuff with "line"
}

If the input stream contains the following: "hello\nhey\ryo\r\ngood-day", then line variable would be following on each iteration:

  1. hello
  2. hey
  3. yo
  4. good-day

I want to read one line at a time, but I want to keep the line-termination character(s):

  1. hello\n
  2. hey\r
  3. yo\r\n
  4. good-day

How can I do this? Is there a ready-made classes I can use?

--

Update:

Here's what I'm trying to do and why I need to keep the end-of-line character (and why the EOL character may be different).

I'm reading a POST request. They consists of pure text messages where the lines always end with \r\n (by the standard specification). However POST request may contain binary data, which may contain bytes that look like termination characters to Java Reader objects.

In my example, an image is being uploaded. The image data is sent on a single line. However, however the image's binary data contains bytes that the READER would interpret as "\n", "\r" or sometimes "\r\n" if those two bytes happens to be next to each other.

I have to read the POST request one line at a time because that's how it works. I suppose, I COULD read everything and then parse the whole thing. But that's not efficient, especially if a large file (say 1024 MiB) file is being uploaded.

12
задан Oak Bytes 7 July 2012 в 01:03
поделиться