Skip to content
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

Phcoder cherrypicks #238

Merged
merged 46 commits into from
Aug 23, 2016
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
45abc0e
Revert "Remove support for editing files."
phcoder Nov 17, 2015
bd7c6d1
Don't use coffeescript for internal editor
maks Aug 4, 2016
f63c813
Add copy whole file to editor
maks Aug 4, 2016
6dbfb8d
Add ssh key generation and exporting
phcoder Oct 29, 2015
d5b5086
Don't rtrim the buffer.
phcoder Aug 5, 2016
8874fa1
Improve commit metadata checks
maks Aug 17, 2016
cbb02af
Change commit view to be more in line with usual android interface
phcoder Nov 5, 2015
ed4e3c0
Add ability to create a branch from any commit
phcoder Nov 6, 2015
070fa35
Save and share a diff
maks Aug 17, 2016
8cdcaaf
Remove SheimiArrayAdapter
phcoder Nov 7, 2015
a29d46a
Make branch picker an activity
phcoder Nov 7, 2015
01e3e16
Add branch menu to create and delete branches
phcoder Nov 8, 2015
608dd86
Prevent NPE using up affordance from BranchChooser
maks Aug 18, 2016
26b83c7
Track item visual selection in actionmode
maks Aug 18, 2016
cb35d53
Show author and not committer in short list
phcoder Nov 8, 2015
e285469
Show the name of key to be deleted.
phcoder Nov 8, 2015
222c8e4
Track item visual selection in actionmodei:SSH Key
maks Aug 18, 2016
af72597
Don't swallow subsequent lines on amend.
phcoder Nov 19, 2015
d2c72ae
Fix commitdiff header
phcoder Nov 21, 2015
afacf8b
Add support for setting commit author.
phcoder Nov 21, 2015
055af6e
Add force pull functionality
phcoder Nov 22, 2015
9785bb4
Allow rebase on non-local branch
phcoder Nov 23, 2015
90c070b
Clear merge and rebase status in force pull
phcoder Nov 23, 2015
3acfa4d
Discard rebases and merges on hard reset.
phcoder Nov 25, 2015
eeaed38
Add staged and unstaged diff functionality
phcoder Nov 25, 2015
07f0af6
Show public key on click on key
phcoder Nov 25, 2015
590e970
Limit author autocomplete to 500 last commits.
phcoder Nov 25, 2015
f7e3af0
Add an Action to edit raw config
phcoder Dec 5, 2015
55ac594
Respect user.name and user.email in config
phcoder Dec 5, 2015
de28f32
Add config dialog.
phcoder Dec 5, 2015
94133dc
Restructure import of local repo for future migration to OPEN_DOCUMEN…
phcoder Dec 6, 2015
368036a
Implement commit search
phcoder Dec 8, 2015
3e3c5e1
Import midnight codemirror theme
phcoder Dec 9, 2015
b0c93e5
Add missing COPYING file.
phcoder Dec 9, 2015
870d78a
Dark theme
phcoder Dec 9, 2015
2163a24
Commits touching a file
phcoder Dec 9, 2015
353276f
Do not include old commit in title when printing a commitdiff
phcoder Dec 9, 2015
ba41622
Optimize commit search
phcoder Dec 9, 2015
a8424c8
tidy up from cherry-picks
maks Aug 23, 2016
899e107
Fix crash on commit tab rotate
phcoder Dec 12, 2015
69519a5
Improve responsiveness to commit search
phcoder Dec 12, 2015
3c24614
Fix bugs with backrounf commit search
phcoder Dec 13, 2015
c3d6c3f
Fix accidental search in parents field
phcoder Dec 13, 2015
17e240c
Fix save icon bug
phcoder Dec 18, 2015
fa8f646
Update codemirror version to HEAD
phcoder Jan 1, 2016
6ea23fc
Fix unit test to match code changes
maks Aug 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Respect user.name and user.email in config
(cherry picked from commit 3d11df0)
Signed-off-by: Maksim Lin <[email protected]>
  • Loading branch information
phcoder authored and maks committed Aug 22, 2016
commit 55ac594f58766669821a0d06afb22f15ba157ed3
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.eclipse.jgit.api.errors.NoMessageException;
import org.eclipse.jgit.api.errors.UnmergedPathsException;
import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
import org.eclipse.jgit.lib.StoredConfig;

import me.sheimi.android.utils.Profile;
import me.sheimi.sgit.R;
Expand Down Expand Up @@ -71,8 +72,16 @@ public static void commit(Repo repo, boolean stageAll, boolean isAmend,
UnmergedPathsException, ConcurrentRefUpdateException,
WrongRepositoryStateException, GitAPIException, StopTaskException {
Context context = SGitApplication.getContext();
String committerName = Profile.getUsername(context);
String committerEmail = Profile.getEmail(context);
StoredConfig config = repo.getGit().getRepository().getConfig();
String committerEmail = config.getString("user", null, "email");
String committerName = config.getString("user", null, "name");

if (committerName == null || committerName.equals("")) {
committerName = Profile.getUsername(context);
}
if (committerEmail == null || committerEmail.equals("")) {
committerEmail = Profile.getEmail(context);
}
if (committerName.isEmpty() || committerEmail.isEmpty()) {
throw new Exception("Please set your name and email");
}
Expand Down