-
Notifications
You must be signed in to change notification settings - Fork 0
Java06. ДЗ 03, Егоров Антон #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Добавлен скрипт для запуска. Добавлено сообщение о недостаточном количестве аргументов.
Добавлен базовый тест к нему. getChangedFiles и getDeletedFiles теперь только на файлы в текущем пути до корня смотрят.
После merge напоминание о том что надо сделать коммит.
| public class BranchProblemException extends Exception { | ||
| String message; | ||
| public BranchProblemException(String s) { | ||
| message = s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super(message), см конструкторы Exception
| .collect( | ||
| Collectors.joining("\n") | ||
| ) | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String.join("\n", processArgs(args))
| try { | ||
| revision = Integer.parseInt(args[1]); | ||
| res.add("Checkout to revision " + revision); | ||
| core.makeCheckout(revision - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
конвертация ревизии в представление для пользователя и обратно должна быть в одном месте (+/-1)
| res.add("IOException: " + e.getMessage()); | ||
| } catch (ArrayIndexOutOfBoundsException e) { | ||
| res.add("Lack of arguments"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше ловить исключения как можно ближе к месту появления, например, ArrayIndexOutOfBoundsException может вылететь не по той причине, что будет написана в консоли
| } | ||
| inform.detachedHeadRevision = currDetachedPosT; | ||
|
|
||
| updateRepInformation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не подчищаются метаданные
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очищаются файлы, которые добавлены и которые удалены. Остальное сохраняется, как в настоящем git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в настоящем гите есть сборщик мусора )
|
|
||
| TreeMap<Integer, Integer> branchEnds = new TreeMap<>(); | ||
|
|
||
| ArrayList<Integer> numberOfStartedBranchesAtRevision = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по сути не используется
|
|
||
| inform.branchNumbers.remove(branchName); | ||
|
|
||
| updateRepInformation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тоже не чистятся метаданные
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь удаляется имя ветки, но коммиты остаются. В git вроде так.
No description provided.