You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

repo.go 73 kB

11 years ago
11 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
11 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. "bytes"
  7. "errors"
  8. "fmt"
  9. "html/template"
  10. "io"
  11. "io/ioutil"
  12. "mime/multipart"
  13. "os"
  14. "os/exec"
  15. "path"
  16. "path/filepath"
  17. "regexp"
  18. "sort"
  19. "strings"
  20. "time"
  21. "github.com/Unknwon/cae/zip"
  22. "github.com/Unknwon/com"
  23. "github.com/go-xorm/xorm"
  24. "github.com/mcuadros/go-version"
  25. "gopkg.in/ini.v1"
  26. git "github.com/gogits/git-module"
  27. api "github.com/gogits/go-gogs-client"
  28. gouuid "github.com/satori/go.uuid"
  29. "github.com/gogits/gogs/modules/bindata"
  30. "github.com/gogits/gogs/modules/log"
  31. "github.com/gogits/gogs/modules/markdown"
  32. "github.com/gogits/gogs/modules/process"
  33. "github.com/gogits/gogs/modules/setting"
  34. "github.com/gogits/gogs/modules/sync"
  35. )
  36. const (
  37. _TPL_UPDATE_HOOK = "#!/usr/bin/env %s\n%s update $1 $2 $3 --config='%s'\n"
  38. )
  39. var repoWorkingPool = sync.NewSingleInstancePool()
  40. var (
  41. ErrRepoFileNotExist = errors.New("Repository file does not exist")
  42. ErrRepoFileNotLoaded = errors.New("Repository file not loaded")
  43. ErrMirrorNotExist = errors.New("Mirror does not exist")
  44. ErrInvalidReference = errors.New("Invalid reference specified")
  45. ErrNameEmpty = errors.New("Name is empty")
  46. )
  47. var (
  48. Gitignores, Licenses, Readmes []string
  49. // Maximum items per page in forks, watchers and stars of a repo
  50. ItemsPerPage = 40
  51. )
  52. func LoadRepoConfig() {
  53. // Load .gitignore and license files and readme templates.
  54. // TODO: should we allow custom files overwrite default ones?
  55. types := []string{"gitignore", "license", "readme"}
  56. typeFiles := make([][]string, 3)
  57. for i, t := range types {
  58. files, err := bindata.AssetDir("conf/" + t)
  59. if err != nil {
  60. log.Fatal(4, "Fail to get %s files: %v", t, err)
  61. }
  62. customPath := path.Join(setting.CustomPath, "conf", t)
  63. if com.IsDir(customPath) {
  64. customFiles, err := com.StatDir(customPath)
  65. if err != nil {
  66. log.Fatal(4, "Fail to get custom %s files: %v", t, err)
  67. }
  68. for _, f := range customFiles {
  69. if !com.IsSliceContainsStr(files, f) {
  70. files = append(files, f)
  71. }
  72. }
  73. }
  74. typeFiles[i] = files
  75. }
  76. Gitignores = typeFiles[0]
  77. Licenses = typeFiles[1]
  78. Readmes = typeFiles[2]
  79. sort.Strings(Gitignores)
  80. sort.Strings(Licenses)
  81. sort.Strings(Readmes)
  82. // Filter out invalid names and promote preferred licenses.
  83. sortedLicenses := make([]string, 0, len(Licenses))
  84. for _, name := range setting.Repository.PreferredLicenses {
  85. if com.IsSliceContainsStr(Licenses, name) {
  86. sortedLicenses = append(sortedLicenses, name)
  87. }
  88. }
  89. for _, name := range Licenses {
  90. if !com.IsSliceContainsStr(setting.Repository.PreferredLicenses, name) {
  91. sortedLicenses = append(sortedLicenses, name)
  92. }
  93. }
  94. Licenses = sortedLicenses
  95. }
  96. func NewRepoContext() {
  97. zip.Verbose = false
  98. // Check Git installation.
  99. if _, err := exec.LookPath("git"); err != nil {
  100. log.Fatal(4, "Fail to test 'git' command: %v (forgotten install?)", err)
  101. }
  102. // Check Git version.
  103. gitVer, err := git.BinVersion()
  104. if err != nil {
  105. log.Fatal(4, "Fail to get Git version: %v", err)
  106. }
  107. log.Info("Git Version: %s", gitVer)
  108. if version.Compare("1.7.1", gitVer, ">") {
  109. log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
  110. }
  111. // Git requires setting user.name and user.email in order to commit changes.
  112. for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {
  113. if stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" {
  114. // ExitError indicates this config is not set
  115. if _, ok := err.(*exec.ExitError); ok || strings.TrimSpace(stdout) == "" {
  116. if _, stderr, gerr := process.Exec("NewRepoContext(set "+configKey+")", "git", "config", "--global", configKey, defaultValue); gerr != nil {
  117. log.Fatal(4, "Fail to set git %s(%s): %s", configKey, gerr, stderr)
  118. }
  119. log.Info("Git config %s set to %s", configKey, defaultValue)
  120. } else {
  121. log.Fatal(4, "Fail to get git %s(%s): %s", configKey, err, stderr)
  122. }
  123. }
  124. }
  125. // Set git some configurations.
  126. if _, stderr, err := process.Exec("NewRepoContext(git config --global core.quotepath false)",
  127. "git", "config", "--global", "core.quotepath", "false"); err != nil {
  128. log.Fatal(4, "Fail to execute 'git config --global core.quotepath false': %s", stderr)
  129. }
  130. RemoveAllWithNotice("Clean up repository temporary data", filepath.Join(setting.AppDataPath, "tmp"))
  131. }
  132. // Repository represents a git repository.
  133. type Repository struct {
  134. ID int64 `xorm:"pk autoincr"`
  135. OwnerID int64 `xorm:"UNIQUE(s)"`
  136. Owner *User `xorm:"-"`
  137. LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
  138. Name string `xorm:"INDEX NOT NULL"`
  139. Description string
  140. Website string
  141. DefaultBranch string
  142. NumWatches int
  143. NumStars int
  144. NumForks int
  145. NumIssues int
  146. NumClosedIssues int
  147. NumOpenIssues int `xorm:"-"`
  148. NumPulls int
  149. NumClosedPulls int
  150. NumOpenPulls int `xorm:"-"`
  151. NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
  152. NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
  153. NumOpenMilestones int `xorm:"-"`
  154. NumTags int `xorm:"-"`
  155. IsPrivate bool
  156. IsBare bool
  157. IsMirror bool
  158. *Mirror `xorm:"-"`
  159. // Advanced settings
  160. EnableWiki bool `xorm:"NOT NULL DEFAULT true"`
  161. EnableExternalWiki bool
  162. ExternalWikiURL string
  163. EnableIssues bool `xorm:"NOT NULL DEFAULT true"`
  164. EnableExternalTracker bool
  165. ExternalTrackerFormat string
  166. ExternalTrackerStyle string
  167. ExternalMetas map[string]string `xorm:"-"`
  168. EnablePulls bool `xorm:"NOT NULL DEFAULT true"`
  169. IsFork bool `xorm:"NOT NULL DEFAULT false"`
  170. ForkID int64
  171. BaseRepo *Repository `xorm:"-"`
  172. Created time.Time `xorm:"-"`
  173. CreatedUnix int64
  174. Updated time.Time `xorm:"-"`
  175. UpdatedUnix int64
  176. }
  177. func (repo *Repository) BeforeInsert() {
  178. repo.CreatedUnix = time.Now().Unix()
  179. repo.UpdatedUnix = repo.CreatedUnix
  180. }
  181. func (repo *Repository) BeforeUpdate() {
  182. repo.UpdatedUnix = time.Now().Unix()
  183. }
  184. func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
  185. switch colName {
  186. case "default_branch":
  187. // FIXME: use models migration to solve all at once.
  188. if len(repo.DefaultBranch) == 0 {
  189. repo.DefaultBranch = "master"
  190. }
  191. case "num_closed_issues":
  192. repo.NumOpenIssues = repo.NumIssues - repo.NumClosedIssues
  193. case "num_closed_pulls":
  194. repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
  195. case "num_closed_milestones":
  196. repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
  197. case "external_tracker_style":
  198. if len(repo.ExternalTrackerStyle) == 0 {
  199. repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
  200. }
  201. case "created_unix":
  202. repo.Created = time.Unix(repo.CreatedUnix, 0).Local()
  203. case "updated_unix":
  204. repo.Updated = time.Unix(repo.UpdatedUnix, 0)
  205. }
  206. }
  207. // MustOwner always returns a valid *User object to avoid
  208. // conceptually impossible error handling.
  209. // It creates a fake object that contains error deftail
  210. // when error occurs.
  211. func (repo *Repository) MustOwner() *User {
  212. return repo.mustOwner(x)
  213. }
  214. func (repo *Repository) FullName() string {
  215. return repo.MustOwner().Name + "/" + repo.Name
  216. }
  217. func (repo *Repository) HTMLURL() string {
  218. return setting.AppUrl + repo.FullName()
  219. }
  220. // Arguments that are allowed to be nil: permission
  221. func (repo *Repository) APIFormat(permission *api.Permission) *api.Repository {
  222. cloneLink := repo.CloneLink()
  223. return &api.Repository{
  224. ID: repo.ID,
  225. Owner: repo.Owner.APIFormat(),
  226. Name: repo.Name,
  227. FullName: repo.FullName(),
  228. Description: repo.Description,
  229. Private: repo.IsPrivate,
  230. Fork: repo.IsFork,
  231. HTMLURL: repo.HTMLURL(),
  232. SSHURL: cloneLink.SSH,
  233. CloneURL: cloneLink.HTTPS,
  234. Website: repo.Website,
  235. Stars: repo.NumStars,
  236. Forks: repo.NumForks,
  237. Watchers: repo.NumWatches,
  238. OpenIssues: repo.NumOpenIssues,
  239. DefaultBranch: repo.DefaultBranch,
  240. Created: repo.Created,
  241. Updated: repo.Updated,
  242. Permissions: permission,
  243. }
  244. }
  245. func (repo *Repository) getOwner(e Engine) (err error) {
  246. if repo.Owner != nil {
  247. return nil
  248. }
  249. repo.Owner, err = getUserByID(e, repo.OwnerID)
  250. return err
  251. }
  252. func (repo *Repository) GetOwner() error {
  253. return repo.getOwner(x)
  254. }
  255. func (repo *Repository) mustOwner(e Engine) *User {
  256. if err := repo.getOwner(e); err != nil {
  257. return &User{
  258. Name: "error",
  259. FullName: err.Error(),
  260. }
  261. }
  262. return repo.Owner
  263. }
  264. // ComposeMetas composes a map of metas for rendering external issue tracker URL.
  265. func (repo *Repository) ComposeMetas() map[string]string {
  266. if !repo.EnableExternalTracker {
  267. return nil
  268. } else if repo.ExternalMetas == nil {
  269. repo.ExternalMetas = map[string]string{
  270. "format": repo.ExternalTrackerFormat,
  271. "user": repo.MustOwner().Name,
  272. "repo": repo.Name,
  273. }
  274. switch repo.ExternalTrackerStyle {
  275. case markdown.ISSUE_NAME_STYLE_ALPHANUMERIC:
  276. repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
  277. default:
  278. repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_NUMERIC
  279. }
  280. }
  281. return repo.ExternalMetas
  282. }
  283. // DeleteWiki removes the actual and local copy of repository wiki.
  284. func (repo *Repository) DeleteWiki() {
  285. wikiPaths := []string{repo.WikiPath(), repo.LocalWikiPath()}
  286. for _, wikiPath := range wikiPaths {
  287. RemoveAllWithNotice("Delete repository wiki", wikiPath)
  288. }
  289. }
  290. func (repo *Repository) getAssignees(e Engine) (_ []*User, err error) {
  291. if err = repo.getOwner(e); err != nil {
  292. return nil, err
  293. }
  294. accesses := make([]*Access, 0, 10)
  295. if err = e.Where("repo_id = ? AND mode >= ?", repo.ID, ACCESS_MODE_WRITE).Find(&accesses); err != nil {
  296. return nil, err
  297. }
  298. // Leave a seat for owner itself to append later, but if owner is an organization
  299. // and just waste 1 unit is cheaper than re-allocate memory once.
  300. users := make([]*User, 0, len(accesses)+1)
  301. if len(accesses) > 0 {
  302. userIDs := make([]int64, len(accesses))
  303. for i := 0; i < len(accesses); i++ {
  304. userIDs[i] = accesses[i].UserID
  305. }
  306. if err = e.In("id", userIDs).Find(&users); err != nil {
  307. return nil, err
  308. }
  309. }
  310. if !repo.Owner.IsOrganization() {
  311. users = append(users, repo.Owner)
  312. }
  313. return users, nil
  314. }
  315. // GetAssignees returns all users that have write access and can be assigned to issues
  316. // of the repository,
  317. func (repo *Repository) GetAssignees() (_ []*User, err error) {
  318. return repo.getAssignees(x)
  319. }
  320. // GetAssigneeByID returns the user that has write access of repository by given ID.
  321. func (repo *Repository) GetAssigneeByID(userID int64) (*User, error) {
  322. return GetAssigneeByID(repo, userID)
  323. }
  324. // GetMilestoneByID returns the milestone belongs to repository by given ID.
  325. func (repo *Repository) GetMilestoneByID(milestoneID int64) (*Milestone, error) {
  326. return GetMilestoneByRepoID(repo.ID, milestoneID)
  327. }
  328. // IssueStats returns number of open and closed repository issues by given filter mode.
  329. func (repo *Repository) IssueStats(uid int64, filterMode int, isPull bool) (int64, int64) {
  330. return GetRepoIssueStats(repo.ID, uid, filterMode, isPull)
  331. }
  332. func (repo *Repository) GetMirror() (err error) {
  333. repo.Mirror, err = GetMirror(repo.ID)
  334. return err
  335. }
  336. func (repo *Repository) GetBaseRepo() (err error) {
  337. if !repo.IsFork {
  338. return nil
  339. }
  340. repo.BaseRepo, err = GetRepositoryByID(repo.ForkID)
  341. return err
  342. }
  343. func (repo *Repository) repoPath(e Engine) string {
  344. return RepoPath(repo.mustOwner(e).Name, repo.Name)
  345. }
  346. func (repo *Repository) RepoPath() string {
  347. return repo.repoPath(x)
  348. }
  349. func (repo *Repository) GitConfigPath() string {
  350. return filepath.Join(repo.RepoPath(), "config")
  351. }
  352. func (repo *Repository) RelLink() string {
  353. return "/" + repo.FullName()
  354. }
  355. func (repo *Repository) Link() string {
  356. return setting.AppSubUrl + "/" + repo.FullName()
  357. }
  358. func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string {
  359. return fmt.Sprintf("%s/%s/compare/%s...%s", repo.MustOwner().Name, repo.Name, oldCommitID, newCommitID)
  360. }
  361. func (repo *Repository) HasAccess(u *User) bool {
  362. has, _ := HasAccess(u, repo, ACCESS_MODE_READ)
  363. return has
  364. }
  365. func (repo *Repository) IsOwnedBy(userID int64) bool {
  366. return repo.OwnerID == userID
  367. }
  368. // CanBeForked returns true if repository meets the requirements of being forked.
  369. func (repo *Repository) CanBeForked() bool {
  370. return !repo.IsBare
  371. }
  372. // CanEnablePulls returns true if repository meets the requirements of accepting pulls.
  373. func (repo *Repository) CanEnablePulls() bool {
  374. return !repo.IsMirror
  375. }
  376. // AllowPulls returns true if repository meets the requirements of accepting pulls and has them enabled.
  377. func (repo *Repository) AllowsPulls() bool {
  378. return repo.CanEnablePulls() && repo.EnablePulls
  379. }
  380. // CanEnableEditor returns true if repository meets the requirements of web editor.
  381. func (repo *Repository) CanEnableEditor() bool {
  382. return !repo.IsMirror
  383. }
  384. // FIXME: should have a mutex to prevent producing same index for two issues that are created
  385. // closely enough.
  386. func (repo *Repository) NextIssueIndex() int64 {
  387. return int64(repo.NumIssues+repo.NumPulls) + 1
  388. }
  389. var (
  390. DescPattern = regexp.MustCompile(`https?://\S+`)
  391. )
  392. // DescriptionHtml does special handles to description and return HTML string.
  393. func (repo *Repository) DescriptionHtml() template.HTML {
  394. sanitize := func(s string) string {
  395. return fmt.Sprintf(`<a href="%[1]s" target="_blank">%[1]s</a>`, s)
  396. }
  397. return template.HTML(DescPattern.ReplaceAllStringFunc(markdown.Sanitizer.Sanitize(repo.Description), sanitize))
  398. }
  399. func (repo *Repository) LocalCopyPath() string {
  400. return path.Join(setting.AppDataPath, "tmp/local-rpeo", com.ToStr(repo.ID))
  401. }
  402. // UpdateLocalCopy pulls latest changes of given branch from repoPath to localPath.
  403. // It creates a new clone if local copy does not exist.
  404. // This function checks out target branch by default, it is safe to assume subsequent
  405. // operations are operating against target branch when caller has confidence for no race condition.
  406. func UpdateLocalCopyBranch(repoPath, localPath, branch string) error {
  407. if !com.IsExist(localPath) {
  408. if err := git.Clone(repoPath, localPath, git.CloneRepoOptions{
  409. Timeout: time.Duration(setting.Git.Timeout.Clone) * time.Second,
  410. Branch: branch,
  411. }); err != nil {
  412. return fmt.Errorf("git clone %s: %v", branch, err)
  413. }
  414. } else {
  415. if err := git.Checkout(localPath, git.CheckoutOptions{
  416. Branch: branch,
  417. }); err != nil {
  418. return fmt.Errorf("git checkout %s: %v", branch, err)
  419. }
  420. if err := git.Pull(localPath, git.PullRemoteOptions{
  421. Timeout: time.Duration(setting.Git.Timeout.Pull) * time.Second,
  422. Remote: "origin",
  423. Branch: branch,
  424. }); err != nil {
  425. return fmt.Errorf("git pull origin %s: %v", branch, err)
  426. }
  427. }
  428. return nil
  429. }
  430. // UpdateLocalCopyBranch makes sure local copy of repository in given branch is up-to-date.
  431. func (repo *Repository) UpdateLocalCopyBranch(branch string) error {
  432. return UpdateLocalCopyBranch(repo.RepoPath(), repo.LocalCopyPath(), branch)
  433. }
  434. // PatchPath returns corresponding patch file path of repository by given issue ID.
  435. func (repo *Repository) PatchPath(index int64) (string, error) {
  436. if err := repo.GetOwner(); err != nil {
  437. return "", err
  438. }
  439. return filepath.Join(RepoPath(repo.Owner.Name, repo.Name), "pulls", com.ToStr(index)+".patch"), nil
  440. }
  441. // SavePatch saves patch data to corresponding location by given issue ID.
  442. func (repo *Repository) SavePatch(index int64, patch []byte) error {
  443. patchPath, err := repo.PatchPath(index)
  444. if err != nil {
  445. return fmt.Errorf("PatchPath: %v", err)
  446. }
  447. os.MkdirAll(filepath.Dir(patchPath), os.ModePerm)
  448. if err = ioutil.WriteFile(patchPath, patch, 0644); err != nil {
  449. return fmt.Errorf("WriteFile: %v", err)
  450. }
  451. return nil
  452. }
  453. func isRepositoryExist(e Engine, u *User, repoName string) (bool, error) {
  454. has, err := e.Get(&Repository{
  455. OwnerID: u.ID,
  456. LowerName: strings.ToLower(repoName),
  457. })
  458. return has && com.IsDir(RepoPath(u.Name, repoName)), err
  459. }
  460. // IsRepositoryExist returns true if the repository with given name under user has already existed.
  461. func IsRepositoryExist(u *User, repoName string) (bool, error) {
  462. return isRepositoryExist(x, u, repoName)
  463. }
  464. // CloneLink represents different types of clone URLs of repository.
  465. type CloneLink struct {
  466. SSH string
  467. HTTPS string
  468. Git string
  469. }
  470. // ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.
  471. func ComposeHTTPSCloneURL(owner, repo string) string {
  472. return fmt.Sprintf("%s%s/%s.git", setting.AppUrl, owner, repo)
  473. }
  474. func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
  475. repoName := repo.Name
  476. if isWiki {
  477. repoName += ".wiki"
  478. }
  479. repo.Owner = repo.MustOwner()
  480. cl := new(CloneLink)
  481. if setting.SSH.Port != 22 {
  482. cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoName)
  483. } else {
  484. cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
  485. }
  486. cl.HTTPS = ComposeHTTPSCloneURL(repo.Owner.Name, repoName)
  487. return cl
  488. }
  489. // CloneLink returns clone URLs of repository.
  490. func (repo *Repository) CloneLink() (cl *CloneLink) {
  491. return repo.cloneLink(false)
  492. }
  493. // Mirror represents a mirror information of repository.
  494. type Mirror struct {
  495. ID int64 `xorm:"pk autoincr"`
  496. RepoID int64
  497. Repo *Repository `xorm:"-"`
  498. Interval int // Hour.
  499. EnablePrune bool `xorm:"NOT NULL DEFAULT true"`
  500. Updated time.Time `xorm:"-"`
  501. UpdatedUnix int64
  502. NextUpdate time.Time `xorm:"-"`
  503. NextUpdateUnix int64
  504. address string `xorm:"-"`
  505. }
  506. func (m *Mirror) BeforeInsert() {
  507. m.NextUpdateUnix = m.NextUpdate.Unix()
  508. }
  509. func (m *Mirror) BeforeUpdate() {
  510. m.UpdatedUnix = time.Now().Unix()
  511. m.NextUpdateUnix = m.NextUpdate.Unix()
  512. }
  513. func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
  514. var err error
  515. switch colName {
  516. case "repo_id":
  517. m.Repo, err = GetRepositoryByID(m.RepoID)
  518. if err != nil {
  519. log.Error(3, "GetRepositoryByID[%d]: %v", m.ID, err)
  520. }
  521. case "updated_unix":
  522. m.Updated = time.Unix(m.UpdatedUnix, 0).Local()
  523. case "next_updated_unix":
  524. m.NextUpdate = time.Unix(m.NextUpdateUnix, 0).Local()
  525. }
  526. }
  527. func (m *Mirror) readAddress() {
  528. if len(m.address) > 0 {
  529. return
  530. }
  531. cfg, err := ini.Load(m.Repo.GitConfigPath())
  532. if err != nil {
  533. log.Error(4, "Load: %v", err)
  534. return
  535. }
  536. m.address = cfg.Section("remote \"origin\"").Key("url").Value()
  537. }
  538. // HandleCloneUserCredentials replaces user credentials from HTTP/HTTPS URL
  539. // with placeholder <credentials>.
  540. // It will fail for any other forms of clone addresses.
  541. func HandleCloneUserCredentials(url string, mosaics bool) string {
  542. i := strings.Index(url, "@")
  543. if i == -1 {
  544. return url
  545. }
  546. start := strings.Index(url, "://")
  547. if start == -1 {
  548. return url
  549. }
  550. if mosaics {
  551. return url[:start+3] + "<credentials>" + url[i:]
  552. }
  553. return url[:start+3] + url[i+1:]
  554. }
  555. // Address returns mirror address from Git repository config without credentials.
  556. func (m *Mirror) Address() string {
  557. m.readAddress()
  558. return HandleCloneUserCredentials(m.address, false)
  559. }
  560. // FullAddress returns mirror address from Git repository config.
  561. func (m *Mirror) FullAddress() string {
  562. m.readAddress()
  563. return m.address
  564. }
  565. // SaveAddress writes new address to Git repository config.
  566. func (m *Mirror) SaveAddress(addr string) error {
  567. configPath := m.Repo.GitConfigPath()
  568. cfg, err := ini.Load(configPath)
  569. if err != nil {
  570. return fmt.Errorf("Load: %v", err)
  571. }
  572. cfg.Section("remote \"origin\"").Key("url").SetValue(addr)
  573. return cfg.SaveToIndent(configPath, "\t")
  574. }
  575. func getMirror(e Engine, repoId int64) (*Mirror, error) {
  576. m := &Mirror{RepoID: repoId}
  577. has, err := e.Get(m)
  578. if err != nil {
  579. return nil, err
  580. } else if !has {
  581. return nil, ErrMirrorNotExist
  582. }
  583. return m, nil
  584. }
  585. // GetMirror returns mirror object by given repository ID.
  586. func GetMirror(repoId int64) (*Mirror, error) {
  587. return getMirror(x, repoId)
  588. }
  589. func updateMirror(e Engine, m *Mirror) error {
  590. _, err := e.Id(m.ID).AllCols().Update(m)
  591. return err
  592. }
  593. func UpdateMirror(m *Mirror) error {
  594. return updateMirror(x, m)
  595. }
  596. func DeleteMirrorByRepoID(repoID int64) error {
  597. _, err := x.Delete(&Mirror{RepoID: repoID})
  598. return err
  599. }
  600. func createUpdateHook(repoPath string) error {
  601. return git.SetUpdateHook(repoPath,
  602. fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+setting.AppPath+"\"", setting.CustomConf))
  603. }
  604. type MigrateRepoOptions struct {
  605. Name string
  606. Description string
  607. IsPrivate bool
  608. IsMirror bool
  609. RemoteAddr string
  610. }
  611. /*
  612. GitHub, GitLab, Gogs: *.wiki.git
  613. BitBucket: *.git/wiki
  614. */
  615. var commonWikiURLSuffixes = []string{".wiki.git", ".git/wiki"}
  616. // wikiRemoteURL returns accessible repository URL for wiki if exists.
  617. // Otherwise, it returns an empty string.
  618. func wikiRemoteURL(remote string) string {
  619. remote = strings.TrimSuffix(remote, ".git")
  620. for _, suffix := range commonWikiURLSuffixes {
  621. wikiURL := remote + suffix
  622. if git.IsRepoURLAccessible(wikiURL) {
  623. return wikiURL
  624. }
  625. }
  626. return ""
  627. }
  628. // MigrateRepository migrates a existing repository from other project hosting.
  629. func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
  630. repo, err := CreateRepository(u, CreateRepoOptions{
  631. Name: opts.Name,
  632. Description: opts.Description,
  633. IsPrivate: opts.IsPrivate,
  634. IsMirror: opts.IsMirror,
  635. })
  636. if err != nil {
  637. return nil, err
  638. }
  639. // Clone to temprory path and do the init commit.
  640. tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("%d", time.Now().Nanosecond()))
  641. os.MkdirAll(tmpDir, os.ModePerm)
  642. repoPath := RepoPath(u.Name, opts.Name)
  643. wikiPath := WikiPath(u.Name, opts.Name)
  644. if u.IsOrganization() {
  645. t, err := u.GetOwnerTeam()
  646. if err != nil {
  647. return nil, err
  648. }
  649. repo.NumWatches = t.NumMembers
  650. } else {
  651. repo.NumWatches = 1
  652. }
  653. migrateTimeout := time.Duration(setting.Git.Timeout.Migrate) * time.Second
  654. os.RemoveAll(repoPath)
  655. if err = git.Clone(opts.RemoteAddr, repoPath, git.CloneRepoOptions{
  656. Mirror: true,
  657. Quiet: true,
  658. Timeout: migrateTimeout,
  659. }); err != nil {
  660. return repo, fmt.Errorf("Clone: %v", err)
  661. }
  662. wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
  663. if len(wikiRemotePath) > 0 {
  664. os.RemoveAll(wikiPath)
  665. if err = git.Clone(wikiRemotePath, wikiPath, git.CloneRepoOptions{
  666. Mirror: true,
  667. Quiet: true,
  668. Timeout: migrateTimeout,
  669. }); err != nil {
  670. log.Info("Clone wiki: %v", err)
  671. }
  672. }
  673. // Check if repository is empty.
  674. _, stderr, err := com.ExecCmdDir(repoPath, "git", "log", "-1")
  675. if err != nil {
  676. if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {
  677. repo.IsBare = true
  678. } else {
  679. return repo, fmt.Errorf("check bare: %v - %s", err, stderr)
  680. }
  681. }
  682. if !repo.IsBare {
  683. // Try to get HEAD branch and set it as default branch.
  684. gitRepo, err := git.OpenRepository(repoPath)
  685. if err != nil {
  686. return repo, fmt.Errorf("OpenRepository: %v", err)
  687. }
  688. headBranch, err := gitRepo.GetHEADBranch()
  689. if err != nil {
  690. return repo, fmt.Errorf("GetHEADBranch: %v", err)
  691. }
  692. if headBranch != nil {
  693. repo.DefaultBranch = headBranch.Name
  694. }
  695. }
  696. if opts.IsMirror {
  697. if _, err = x.InsertOne(&Mirror{
  698. RepoID: repo.ID,
  699. Interval: setting.Mirror.DefaultInterval,
  700. EnablePrune: true,
  701. NextUpdate: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour),
  702. }); err != nil {
  703. return repo, fmt.Errorf("InsertOne: %v", err)
  704. }
  705. repo.IsMirror = true
  706. return repo, UpdateRepository(repo, false)
  707. }
  708. return CleanUpMigrateInfo(repo)
  709. }
  710. // cleanUpMigrateGitConfig removes mirror info which prevents "push --all".
  711. // This also removes possible user credentials.
  712. func cleanUpMigrateGitConfig(configPath string) error {
  713. cfg, err := ini.Load(configPath)
  714. if err != nil {
  715. return fmt.Errorf("open config file: %v", err)
  716. }
  717. cfg.DeleteSection("remote \"origin\"")
  718. if err = cfg.SaveToIndent(configPath, "\t"); err != nil {
  719. return fmt.Errorf("save config file: %v", err)
  720. }
  721. return nil
  722. }
  723. // Finish migrating repository and/or wiki with things that don't need to be done for mirrors.
  724. func CleanUpMigrateInfo(repo *Repository) (*Repository, error) {
  725. repoPath := repo.RepoPath()
  726. if err := createUpdateHook(repoPath); err != nil {
  727. return repo, fmt.Errorf("createUpdateHook: %v", err)
  728. }
  729. if repo.HasWiki() {
  730. if err := createUpdateHook(repo.WikiPath()); err != nil {
  731. return repo, fmt.Errorf("createUpdateHook (wiki): %v", err)
  732. }
  733. }
  734. if err := cleanUpMigrateGitConfig(repo.GitConfigPath()); err != nil {
  735. return repo, fmt.Errorf("cleanUpMigrateGitConfig: %v", err)
  736. }
  737. if repo.HasWiki() {
  738. if err := cleanUpMigrateGitConfig(path.Join(repo.WikiPath(), "config")); err != nil {
  739. return repo, fmt.Errorf("cleanUpMigrateGitConfig (wiki): %v", err)
  740. }
  741. }
  742. return repo, UpdateRepository(repo, false)
  743. }
  744. // initRepoCommit temporarily changes with work directory.
  745. func initRepoCommit(tmpPath string, sig *git.Signature) (err error) {
  746. var stderr string
  747. if _, stderr, err = process.ExecDir(-1,
  748. tmpPath, fmt.Sprintf("initRepoCommit (git add): %s", tmpPath),
  749. "git", "add", "--all"); err != nil {
  750. return fmt.Errorf("git add: %s", stderr)
  751. }
  752. if _, stderr, err = process.ExecDir(-1,
  753. tmpPath, fmt.Sprintf("initRepoCommit (git commit): %s", tmpPath),
  754. "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email),
  755. "-m", "initial commit"); err != nil {
  756. return fmt.Errorf("git commit: %s", stderr)
  757. }
  758. if _, stderr, err = process.ExecDir(-1,
  759. tmpPath, fmt.Sprintf("initRepoCommit (git push): %s", tmpPath),
  760. "git", "push", "origin", "master"); err != nil {
  761. return fmt.Errorf("git push: %s", stderr)
  762. }
  763. return nil
  764. }
  765. type CreateRepoOptions struct {
  766. Name string
  767. Description string
  768. Gitignores string
  769. License string
  770. Readme string
  771. IsPrivate bool
  772. IsMirror bool
  773. AutoInit bool
  774. }
  775. func getRepoInitFile(tp, name string) ([]byte, error) {
  776. relPath := path.Join("conf", tp, strings.TrimLeft(name, "./"))
  777. // Use custom file when available.
  778. customPath := path.Join(setting.CustomPath, relPath)
  779. if com.IsFile(customPath) {
  780. return ioutil.ReadFile(customPath)
  781. }
  782. return bindata.Asset(relPath)
  783. }
  784. func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRepoOptions) error {
  785. // Clone to temprory path and do the init commit.
  786. _, stderr, err := process.Exec(
  787. fmt.Sprintf("initRepository(git clone): %s", repoPath), "git", "clone", repoPath, tmpDir)
  788. if err != nil {
  789. return fmt.Errorf("git clone: %v - %s", err, stderr)
  790. }
  791. // README
  792. data, err := getRepoInitFile("readme", opts.Readme)
  793. if err != nil {
  794. return fmt.Errorf("getRepoInitFile[%s]: %v", opts.Readme, err)
  795. }
  796. cloneLink := repo.CloneLink()
  797. match := map[string]string{
  798. "Name": repo.Name,
  799. "Description": repo.Description,
  800. "CloneURL.SSH": cloneLink.SSH,
  801. "CloneURL.HTTPS": cloneLink.HTTPS,
  802. }
  803. if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"),
  804. []byte(com.Expand(string(data), match)), 0644); err != nil {
  805. return fmt.Errorf("write README.md: %v", err)
  806. }
  807. // .gitignore
  808. if len(opts.Gitignores) > 0 {
  809. var buf bytes.Buffer
  810. names := strings.Split(opts.Gitignores, ",")
  811. for _, name := range names {
  812. data, err = getRepoInitFile("gitignore", name)
  813. if err != nil {
  814. return fmt.Errorf("getRepoInitFile[%s]: %v", name, err)
  815. }
  816. buf.WriteString("# ---> " + name + "\n")
  817. buf.Write(data)
  818. buf.WriteString("\n")
  819. }
  820. if buf.Len() > 0 {
  821. if err = ioutil.WriteFile(filepath.Join(tmpDir, ".gitignore"), buf.Bytes(), 0644); err != nil {
  822. return fmt.Errorf("write .gitignore: %v", err)
  823. }
  824. }
  825. }
  826. // LICENSE
  827. if len(opts.License) > 0 {
  828. data, err = getRepoInitFile("license", opts.License)
  829. if err != nil {
  830. return fmt.Errorf("getRepoInitFile[%s]: %v", opts.License, err)
  831. }
  832. if err = ioutil.WriteFile(filepath.Join(tmpDir, "LICENSE"), data, 0644); err != nil {
  833. return fmt.Errorf("write LICENSE: %v", err)
  834. }
  835. }
  836. return nil
  837. }
  838. // InitRepository initializes README and .gitignore if needed.
  839. func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts CreateRepoOptions) (err error) {
  840. // Somehow the directory could exist.
  841. if com.IsExist(repoPath) {
  842. return fmt.Errorf("initRepository: path already exists: %s", repoPath)
  843. }
  844. // Init bare new repository.
  845. if err = git.InitRepository(repoPath, true); err != nil {
  846. return fmt.Errorf("InitRepository: %v", err)
  847. } else if err = createUpdateHook(repoPath); err != nil {
  848. return fmt.Errorf("createUpdateHook: %v", err)
  849. }
  850. tmpDir := filepath.Join(os.TempDir(), "gogs-"+repo.Name+"-"+com.ToStr(time.Now().Nanosecond()))
  851. // Initialize repository according to user's choice.
  852. if opts.AutoInit {
  853. os.MkdirAll(tmpDir, os.ModePerm)
  854. defer os.RemoveAll(tmpDir)
  855. if err = prepareRepoCommit(repo, tmpDir, repoPath, opts); err != nil {
  856. return fmt.Errorf("prepareRepoCommit: %v", err)
  857. }
  858. // Apply changes and commit.
  859. if err = initRepoCommit(tmpDir, u.NewGitSig()); err != nil {
  860. return fmt.Errorf("initRepoCommit: %v", err)
  861. }
  862. }
  863. // Re-fetch the repository from database before updating it (else it would
  864. // override changes that were done earlier with sql)
  865. if repo, err = getRepositoryByID(e, repo.ID); err != nil {
  866. return fmt.Errorf("getRepositoryByID: %v", err)
  867. }
  868. if !opts.AutoInit {
  869. repo.IsBare = true
  870. }
  871. repo.DefaultBranch = "master"
  872. if err = updateRepository(e, repo, false); err != nil {
  873. return fmt.Errorf("updateRepository: %v", err)
  874. }
  875. return nil
  876. }
  877. var (
  878. reservedRepoNames = []string{".", ".."}
  879. reservedRepoPatterns = []string{"*.git", "*.wiki"}
  880. )
  881. func IsUsableRepoName(name string) error {
  882. return isUsableName(reservedRepoNames, reservedRepoPatterns, name)
  883. }
  884. func createRepository(e *xorm.Session, u *User, repo *Repository) (err error) {
  885. if err = IsUsableRepoName(repo.Name); err != nil {
  886. return err
  887. }
  888. has, err := isRepositoryExist(e, u, repo.Name)
  889. if err != nil {
  890. return fmt.Errorf("IsRepositoryExist: %v", err)
  891. } else if has {
  892. return ErrRepoAlreadyExist{u.Name, repo.Name}
  893. }
  894. if _, err = e.Insert(repo); err != nil {
  895. return err
  896. }
  897. u.NumRepos++
  898. // Remember visibility preference.
  899. u.LastRepoVisibility = repo.IsPrivate
  900. if err = updateUser(e, u); err != nil {
  901. return fmt.Errorf("updateUser: %v", err)
  902. }
  903. // Give access to all members in owner team.
  904. if u.IsOrganization() {
  905. t, err := u.getOwnerTeam(e)
  906. if err != nil {
  907. return fmt.Errorf("getOwnerTeam: %v", err)
  908. } else if err = t.addRepository(e, repo); err != nil {
  909. return fmt.Errorf("addRepository: %v", err)
  910. }
  911. } else {
  912. // Organization automatically called this in addRepository method.
  913. if err = repo.recalculateAccesses(e); err != nil {
  914. return fmt.Errorf("recalculateAccesses: %v", err)
  915. }
  916. }
  917. if err = watchRepo(e, u.ID, repo.ID, true); err != nil {
  918. return fmt.Errorf("watchRepo: %v", err)
  919. } else if err = newRepoAction(e, u, repo); err != nil {
  920. return fmt.Errorf("newRepoAction: %v", err)
  921. }
  922. return nil
  923. }
  924. // CreateRepository creates a repository for given user or organization.
  925. func CreateRepository(u *User, opts CreateRepoOptions) (_ *Repository, err error) {
  926. if !u.CanCreateRepo() {
  927. return nil, ErrReachLimitOfRepo{u.MaxRepoCreation}
  928. }
  929. repo := &Repository{
  930. OwnerID: u.ID,
  931. Owner: u,
  932. Name: opts.Name,
  933. LowerName: strings.ToLower(opts.Name),
  934. Description: opts.Description,
  935. IsPrivate: opts.IsPrivate,
  936. EnableWiki: true,
  937. EnableIssues: true,
  938. EnablePulls: true,
  939. }
  940. sess := x.NewSession()
  941. defer sessionRelease(sess)
  942. if err = sess.Begin(); err != nil {
  943. return nil, err
  944. }
  945. if err = createRepository(sess, u, repo); err != nil {
  946. return nil, err
  947. }
  948. // No need for init mirror.
  949. if !opts.IsMirror {
  950. repoPath := RepoPath(u.Name, repo.Name)
  951. if err = initRepository(sess, repoPath, u, repo, opts); err != nil {
  952. if err2 := os.RemoveAll(repoPath); err2 != nil {
  953. log.Error(4, "initRepository: %v", err)
  954. return nil, fmt.Errorf(
  955. "delete repo directory %s/%s failed(2): %v", u.Name, repo.Name, err2)
  956. }
  957. return nil, fmt.Errorf("initRepository: %v", err)
  958. }
  959. _, stderr, err := process.ExecDir(-1,
  960. repoPath, fmt.Sprintf("CreateRepository(git update-server-info): %s", repoPath),
  961. "git", "update-server-info")
  962. if err != nil {
  963. return nil, errors.New("CreateRepository(git update-server-info): " + stderr)
  964. }
  965. }
  966. return repo, sess.Commit()
  967. }
  968. func countRepositories(userID int64, private bool) int64 {
  969. sess := x.Where("id > 0")
  970. if userID > 0 {
  971. sess.And("owner_id = ?", userID)
  972. }
  973. if !private {
  974. sess.And("is_private=?", false)
  975. }
  976. count, err := sess.Count(new(Repository))
  977. if err != nil {
  978. log.Error(4, "countRepositories: %v", err)
  979. }
  980. return count
  981. }
  982. // CountRepositories returns number of repositories.
  983. // Argument private only takes effect when it is false,
  984. // set it true to count all repositories.
  985. func CountRepositories(private bool) int64 {
  986. return countRepositories(-1, private)
  987. }
  988. // CountUserRepositories returns number of repositories user owns.
  989. // Argument private only takes effect when it is false,
  990. // set it true to count all repositories.
  991. func CountUserRepositories(userID int64, private bool) int64 {
  992. return countRepositories(userID, private)
  993. }
  994. func Repositories(page, pageSize int) (_ []*Repository, err error) {
  995. repos := make([]*Repository, 0, pageSize)
  996. return repos, x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos)
  997. }
  998. // RepositoriesWithUsers returns number of repos in given page.
  999. func RepositoriesWithUsers(page, pageSize int) (_ []*Repository, err error) {
  1000. repos, err := Repositories(page, pageSize)
  1001. if err != nil {
  1002. return nil, fmt.Errorf("Repositories: %v", err)
  1003. }
  1004. for i := range repos {
  1005. if err = repos[i].GetOwner(); err != nil {
  1006. return nil, err
  1007. }
  1008. }
  1009. return repos, nil
  1010. }
  1011. // RepoPath returns repository path by given user and repository name.
  1012. func RepoPath(userName, repoName string) string {
  1013. return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".git")
  1014. }
  1015. // TransferOwnership transfers all corresponding setting from old user to new one.
  1016. func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error {
  1017. newOwner, err := GetUserByName(newOwnerName)
  1018. if err != nil {
  1019. return fmt.Errorf("get new owner '%s': %v", newOwnerName, err)
  1020. }
  1021. // Check if new owner has repository with same name.
  1022. has, err := IsRepositoryExist(newOwner, repo.Name)
  1023. if err != nil {
  1024. return fmt.Errorf("IsRepositoryExist: %v", err)
  1025. } else if has {
  1026. return ErrRepoAlreadyExist{newOwnerName, repo.Name}
  1027. }
  1028. sess := x.NewSession()
  1029. defer sessionRelease(sess)
  1030. if err = sess.Begin(); err != nil {
  1031. return fmt.Errorf("sess.Begin: %v", err)
  1032. }
  1033. owner := repo.Owner
  1034. // Note: we have to set value here to make sure recalculate accesses is based on
  1035. // new owner.
  1036. repo.OwnerID = newOwner.ID
  1037. repo.Owner = newOwner
  1038. // Update repository.
  1039. if _, err := sess.Id(repo.ID).Update(repo); err != nil {
  1040. return fmt.Errorf("update owner: %v", err)
  1041. }
  1042. // Remove redundant collaborators.
  1043. collaborators, err := repo.getCollaborators(sess)
  1044. if err != nil {
  1045. return fmt.Errorf("getCollaborators: %v", err)
  1046. }
  1047. // Dummy object.
  1048. collaboration := &Collaboration{RepoID: repo.ID}
  1049. for _, c := range collaborators {
  1050. collaboration.UserID = c.ID
  1051. if c.ID == newOwner.ID || newOwner.IsOrgMember(c.ID) {
  1052. if _, err = sess.Delete(collaboration); err != nil {
  1053. return fmt.Errorf("remove collaborator '%d': %v", c.ID, err)
  1054. }
  1055. }
  1056. }
  1057. // Remove old team-repository relations.
  1058. if owner.IsOrganization() {
  1059. if err = owner.getTeams(sess); err != nil {
  1060. return fmt.Errorf("getTeams: %v", err)
  1061. }
  1062. for _, t := range owner.Teams {
  1063. if !t.hasRepository(sess, repo.ID) {
  1064. continue
  1065. }
  1066. t.NumRepos--
  1067. if _, err := sess.Id(t.ID).AllCols().Update(t); err != nil {
  1068. return fmt.Errorf("decrease team repository count '%d': %v", t.ID, err)
  1069. }
  1070. }
  1071. if err = owner.removeOrgRepo(sess, repo.ID); err != nil {
  1072. return fmt.Errorf("removeOrgRepo: %v", err)
  1073. }
  1074. }
  1075. if newOwner.IsOrganization() {
  1076. t, err := newOwner.getOwnerTeam(sess)
  1077. if err != nil {
  1078. return fmt.Errorf("getOwnerTeam: %v", err)
  1079. } else if err = t.addRepository(sess, repo); err != nil {
  1080. return fmt.Errorf("add to owner team: %v", err)
  1081. }
  1082. } else {
  1083. // Organization called this in addRepository method.
  1084. if err = repo.recalculateAccesses(sess); err != nil {
  1085. return fmt.Errorf("recalculateAccesses: %v", err)
  1086. }
  1087. }
  1088. // Update repository count.
  1089. if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos+1 WHERE id=?", newOwner.ID); err != nil {
  1090. return fmt.Errorf("increase new owner repository count: %v", err)
  1091. } else if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos-1 WHERE id=?", owner.ID); err != nil {
  1092. return fmt.Errorf("decrease old owner repository count: %v", err)
  1093. }
  1094. if err = watchRepo(sess, newOwner.ID, repo.ID, true); err != nil {
  1095. return fmt.Errorf("watchRepo: %v", err)
  1096. } else if err = transferRepoAction(sess, doer, owner, repo); err != nil {
  1097. return fmt.Errorf("transferRepoAction: %v", err)
  1098. }
  1099. // Rename remote repository to new path and delete local copy.
  1100. os.MkdirAll(UserPath(newOwner.Name), os.ModePerm)
  1101. if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil {
  1102. return fmt.Errorf("rename repository directory: %v", err)
  1103. }
  1104. RemoveAllWithNotice("Delete repository local copy", repo.LocalCopyPath())
  1105. // Rename remote wiki repository to new path and delete local copy.
  1106. wikiPath := WikiPath(owner.Name, repo.Name)
  1107. if com.IsExist(wikiPath) {
  1108. RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())
  1109. if err = os.Rename(wikiPath, WikiPath(newOwner.Name, repo.Name)); err != nil {
  1110. return fmt.Errorf("rename repository wiki: %v", err)
  1111. }
  1112. }
  1113. return sess.Commit()
  1114. }
  1115. // ChangeRepositoryName changes all corresponding setting from old repository name to new one.
  1116. func ChangeRepositoryName(u *User, oldRepoName, newRepoName string) (err error) {
  1117. oldRepoName = strings.ToLower(oldRepoName)
  1118. newRepoName = strings.ToLower(newRepoName)
  1119. if err = IsUsableRepoName(newRepoName); err != nil {
  1120. return err
  1121. }
  1122. has, err := IsRepositoryExist(u, newRepoName)
  1123. if err != nil {
  1124. return fmt.Errorf("IsRepositoryExist: %v", err)
  1125. } else if has {
  1126. return ErrRepoAlreadyExist{u.Name, newRepoName}
  1127. }
  1128. repo, err := GetRepositoryByName(u.ID, oldRepoName)
  1129. if err != nil {
  1130. return fmt.Errorf("GetRepositoryByName: %v", err)
  1131. }
  1132. // Change repository directory name.
  1133. if err = os.Rename(repo.RepoPath(), RepoPath(u.Name, newRepoName)); err != nil {
  1134. return fmt.Errorf("rename repository directory: %v", err)
  1135. }
  1136. wikiPath := repo.WikiPath()
  1137. if com.IsExist(wikiPath) {
  1138. if err = os.Rename(wikiPath, WikiPath(u.Name, newRepoName)); err != nil {
  1139. return fmt.Errorf("rename repository wiki: %v", err)
  1140. }
  1141. RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())
  1142. }
  1143. return nil
  1144. }
  1145. func getRepositoriesByForkID(e Engine, forkID int64) ([]*Repository, error) {
  1146. repos := make([]*Repository, 0, 10)
  1147. return repos, e.Where("fork_id=?", forkID).Find(&repos)
  1148. }
  1149. // GetRepositoriesByForkID returns all repositories with given fork ID.
  1150. func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
  1151. return getRepositoriesByForkID(x, forkID)
  1152. }
  1153. func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) {
  1154. repo.LowerName = strings.ToLower(repo.Name)
  1155. if len(repo.Description) > 255 {
  1156. repo.Description = repo.Description[:255]
  1157. }
  1158. if len(repo.Website) > 255 {
  1159. repo.Website = repo.Website[:255]
  1160. }
  1161. if _, err = e.Id(repo.ID).AllCols().Update(repo); err != nil {
  1162. return fmt.Errorf("update: %v", err)
  1163. }
  1164. if visibilityChanged {
  1165. if err = repo.getOwner(e); err != nil {
  1166. return fmt.Errorf("getOwner: %v", err)
  1167. }
  1168. if repo.Owner.IsOrganization() {
  1169. // Organization repository need to recalculate access table when visivility is changed.
  1170. if err = repo.recalculateTeamAccesses(e, 0); err != nil {
  1171. return fmt.Errorf("recalculateTeamAccesses: %v", err)
  1172. }
  1173. }
  1174. // Create/Remove git-daemon-export-ok for git-daemon...
  1175. daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
  1176. if repo.IsPrivate && com.IsExist(daemonExportFile) {
  1177. if err = os.Remove(daemonExportFile); err != nil {
  1178. log.Error(4, "Failed to remove %s: %v", daemonExportFile, err)
  1179. }
  1180. } else if !repo.IsPrivate && !com.IsExist(daemonExportFile) {
  1181. if f, err := os.Create(daemonExportFile); err != nil {
  1182. log.Error(4, "Failed to create %s: %v", daemonExportFile, err)
  1183. } else {
  1184. f.Close()
  1185. }
  1186. }
  1187. forkRepos, err := getRepositoriesByForkID(e, repo.ID)
  1188. if err != nil {
  1189. return fmt.Errorf("getRepositoriesByForkID: %v", err)
  1190. }
  1191. for i := range forkRepos {
  1192. forkRepos[i].IsPrivate = repo.IsPrivate
  1193. if err = updateRepository(e, forkRepos[i], true); err != nil {
  1194. return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
  1195. }
  1196. }
  1197. }
  1198. return nil
  1199. }
  1200. func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) {
  1201. sess := x.NewSession()
  1202. defer sessionRelease(sess)
  1203. if err = sess.Begin(); err != nil {
  1204. return err
  1205. }
  1206. if err = updateRepository(x, repo, visibilityChanged); err != nil {
  1207. return fmt.Errorf("updateRepository: %v", err)
  1208. }
  1209. return sess.Commit()
  1210. }
  1211. // DeleteRepository deletes a repository for a user or organization.
  1212. func DeleteRepository(uid, repoID int64) error {
  1213. repo := &Repository{ID: repoID, OwnerID: uid}
  1214. has, err := x.Get(repo)
  1215. if err != nil {
  1216. return err
  1217. } else if !has {
  1218. return ErrRepoNotExist{repoID, uid, ""}
  1219. }
  1220. // In case is a organization.
  1221. org, err := GetUserByID(uid)
  1222. if err != nil {
  1223. return err
  1224. }
  1225. if org.IsOrganization() {
  1226. if err = org.GetTeams(); err != nil {
  1227. return err
  1228. }
  1229. }
  1230. sess := x.NewSession()
  1231. defer sessionRelease(sess)
  1232. if err = sess.Begin(); err != nil {
  1233. return err
  1234. }
  1235. if org.IsOrganization() {
  1236. for _, t := range org.Teams {
  1237. if !t.hasRepository(sess, repoID) {
  1238. continue
  1239. } else if err = t.removeRepository(sess, repo, false); err != nil {
  1240. return err
  1241. }
  1242. }
  1243. }
  1244. if err = deleteBeans(sess,
  1245. &Repository{ID: repoID},
  1246. &Access{RepoID: repo.ID},
  1247. &Action{RepoID: repo.ID},
  1248. &Watch{RepoID: repoID},
  1249. &Star{RepoID: repoID},
  1250. &Mirror{RepoID: repoID},
  1251. &IssueUser{RepoID: repoID},
  1252. &Milestone{RepoID: repoID},
  1253. &Release{RepoID: repoID},
  1254. &Collaboration{RepoID: repoID},
  1255. &PullRequest{BaseRepoID: repoID},
  1256. ); err != nil {
  1257. return fmt.Errorf("deleteBeans: %v", err)
  1258. }
  1259. // Delete comments and attachments.
  1260. issues := make([]*Issue, 0, 25)
  1261. attachmentPaths := make([]string, 0, len(issues))
  1262. if err = sess.Where("repo_id=?", repoID).Find(&issues); err != nil {
  1263. return err
  1264. }
  1265. for i := range issues {
  1266. if _, err = sess.Delete(&Comment{IssueID: issues[i].ID}); err != nil {
  1267. return err
  1268. }
  1269. attachments := make([]*Attachment, 0, 5)
  1270. if err = sess.Where("issue_id=?", issues[i].ID).Find(&attachments); err != nil {
  1271. return err
  1272. }
  1273. for j := range attachments {
  1274. attachmentPaths = append(attachmentPaths, attachments[j].LocalPath())
  1275. }
  1276. if _, err = sess.Delete(&Attachment{IssueID: issues[i].ID}); err != nil {
  1277. return err
  1278. }
  1279. }
  1280. if _, err = sess.Delete(&Issue{RepoID: repoID}); err != nil {
  1281. return err
  1282. }
  1283. if repo.IsFork {
  1284. if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks-1 WHERE id=?", repo.ForkID); err != nil {
  1285. return fmt.Errorf("decrease fork count: %v", err)
  1286. }
  1287. }
  1288. if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos-1 WHERE id=?", uid); err != nil {
  1289. return err
  1290. }
  1291. // Remove repository files.
  1292. repoPath := repo.repoPath(sess)
  1293. RemoveAllWithNotice("Delete repository files", repoPath)
  1294. repo.DeleteWiki()
  1295. // Remove attachment files.
  1296. for i := range attachmentPaths {
  1297. RemoveAllWithNotice("Delete attachment", attachmentPaths[i])
  1298. }
  1299. if err = sess.Commit(); err != nil {
  1300. return fmt.Errorf("Commit: %v", err)
  1301. }
  1302. if repo.NumForks > 0 {
  1303. if _, err = x.Exec("UPDATE `repository` SET fork_id=0,is_fork=? WHERE fork_id=?", false, repo.ID); err != nil {
  1304. log.Error(4, "reset 'fork_id' and 'is_fork': %v", err)
  1305. }
  1306. }
  1307. return nil
  1308. }
  1309. // GetRepositoryByRef returns a Repository specified by a GFM reference.
  1310. // See https://help.github.com/articles/writing-on-github#references for more information on the syntax.
  1311. func GetRepositoryByRef(ref string) (*Repository, error) {
  1312. n := strings.IndexByte(ref, byte('/'))
  1313. if n < 2 {
  1314. return nil, ErrInvalidReference
  1315. }
  1316. userName, repoName := ref[:n], ref[n+1:]
  1317. user, err := GetUserByName(userName)
  1318. if err != nil {
  1319. return nil, err
  1320. }
  1321. return GetRepositoryByName(user.ID, repoName)
  1322. }
  1323. // GetRepositoryByName returns the repository by given name under user if exists.
  1324. func GetRepositoryByName(ownerID int64, name string) (*Repository, error) {
  1325. repo := &Repository{
  1326. OwnerID: ownerID,
  1327. LowerName: strings.ToLower(name),
  1328. }
  1329. has, err := x.Get(repo)
  1330. if err != nil {
  1331. return nil, err
  1332. } else if !has {
  1333. return nil, ErrRepoNotExist{0, ownerID, name}
  1334. }
  1335. return repo, err
  1336. }
  1337. func getRepositoryByID(e Engine, id int64) (*Repository, error) {
  1338. repo := new(Repository)
  1339. has, err := e.Id(id).Get(repo)
  1340. if err != nil {
  1341. return nil, err
  1342. } else if !has {
  1343. return nil, ErrRepoNotExist{id, 0, ""}
  1344. }
  1345. return repo, nil
  1346. }
  1347. // GetRepositoryByID returns the repository by given id if exists.
  1348. func GetRepositoryByID(id int64) (*Repository, error) {
  1349. return getRepositoryByID(x, id)
  1350. }
  1351. // GetUserRepositories returns a list of repositories of given user.
  1352. func GetUserRepositories(userID int64, private bool, page, pageSize int) ([]*Repository, error) {
  1353. sess := x.Where("owner_id = ?", userID).Desc("updated_unix")
  1354. if !private {
  1355. sess.And("is_private=?", false)
  1356. }
  1357. if page <= 0 {
  1358. page = 1
  1359. }
  1360. sess.Limit(pageSize, (page-1)*pageSize)
  1361. repos := make([]*Repository, 0, pageSize)
  1362. return repos, sess.Find(&repos)
  1363. }
  1364. // GetUserRepositories returns a list of mirror repositories of given user.
  1365. func GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
  1366. repos := make([]*Repository, 0, 10)
  1367. return repos, x.Where("owner_id = ?", userID).And("is_mirror = ?", true).Find(&repos)
  1368. }
  1369. // GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
  1370. func GetRecentUpdatedRepositories(page, pageSize int) (repos []*Repository, err error) {
  1371. return repos, x.Limit(pageSize, (page-1)*pageSize).
  1372. Where("is_private=?", false).Limit(pageSize).Desc("updated_unix").Find(&repos)
  1373. }
  1374. func getRepositoryCount(e Engine, u *User) (int64, error) {
  1375. return x.Count(&Repository{OwnerID: u.ID})
  1376. }
  1377. // GetRepositoryCount returns the total number of repositories of user.
  1378. func GetRepositoryCount(u *User) (int64, error) {
  1379. return getRepositoryCount(x, u)
  1380. }
  1381. type SearchRepoOptions struct {
  1382. Keyword string
  1383. OwnerID int64
  1384. OrderBy string
  1385. Private bool // Include private repositories in results
  1386. Page int
  1387. PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
  1388. }
  1389. // SearchRepositoryByName takes keyword and part of repository name to search,
  1390. // it returns results in given range and number of total results.
  1391. func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int64, _ error) {
  1392. if len(opts.Keyword) == 0 {
  1393. return repos, 0, nil
  1394. }
  1395. opts.Keyword = strings.ToLower(opts.Keyword)
  1396. if opts.Page <= 0 {
  1397. opts.Page = 1
  1398. }
  1399. repos = make([]*Repository, 0, opts.PageSize)
  1400. // Append conditions
  1401. sess := x.Where("LOWER(lower_name) LIKE ?", "%"+opts.Keyword+"%")
  1402. if opts.OwnerID > 0 {
  1403. sess.And("owner_id = ?", opts.OwnerID)
  1404. }
  1405. if !opts.Private {
  1406. sess.And("is_private=?", false)
  1407. }
  1408. var countSess xorm.Session
  1409. countSess = *sess
  1410. count, err := countSess.Count(new(Repository))
  1411. if err != nil {
  1412. return nil, 0, fmt.Errorf("Count: %v", err)
  1413. }
  1414. if len(opts.OrderBy) > 0 {
  1415. sess.OrderBy(opts.OrderBy)
  1416. }
  1417. return repos, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
  1418. }
  1419. // DeleteRepositoryArchives deletes all repositories' archives.
  1420. func DeleteRepositoryArchives() error {
  1421. return x.Where("id > 0").Iterate(new(Repository),
  1422. func(idx int, bean interface{}) error {
  1423. repo := bean.(*Repository)
  1424. return os.RemoveAll(filepath.Join(repo.RepoPath(), "archives"))
  1425. })
  1426. }
  1427. func gatherMissingRepoRecords() ([]*Repository, error) {
  1428. repos := make([]*Repository, 0, 10)
  1429. if err := x.Where("id > 0").Iterate(new(Repository),
  1430. func(idx int, bean interface{}) error {
  1431. repo := bean.(*Repository)
  1432. if !com.IsDir(repo.RepoPath()) {
  1433. repos = append(repos, repo)
  1434. }
  1435. return nil
  1436. }); err != nil {
  1437. if err2 := CreateRepositoryNotice(fmt.Sprintf("gatherMissingRepoRecords: %v", err)); err2 != nil {
  1438. return nil, fmt.Errorf("CreateRepositoryNotice: %v", err)
  1439. }
  1440. }
  1441. return repos, nil
  1442. }
  1443. // DeleteMissingRepositories deletes all repository records that lost Git files.
  1444. func DeleteMissingRepositories() error {
  1445. repos, err := gatherMissingRepoRecords()
  1446. if err != nil {
  1447. return fmt.Errorf("gatherMissingRepoRecords: %v", err)
  1448. }
  1449. if len(repos) == 0 {
  1450. return nil
  1451. }
  1452. for _, repo := range repos {
  1453. log.Trace("Deleting %d/%d...", repo.OwnerID, repo.ID)
  1454. if err := DeleteRepository(repo.OwnerID, repo.ID); err != nil {
  1455. if err2 := CreateRepositoryNotice(fmt.Sprintf("DeleteRepository [%d]: %v", repo.ID, err)); err2 != nil {
  1456. return fmt.Errorf("CreateRepositoryNotice: %v", err)
  1457. }
  1458. }
  1459. }
  1460. return nil
  1461. }
  1462. // ReinitMissingRepositories reinitializes all repository records that lost Git files.
  1463. func ReinitMissingRepositories() error {
  1464. repos, err := gatherMissingRepoRecords()
  1465. if err != nil {
  1466. return fmt.Errorf("gatherMissingRepoRecords: %v", err)
  1467. }
  1468. if len(repos) == 0 {
  1469. return nil
  1470. }
  1471. for _, repo := range repos {
  1472. log.Trace("Initializing %d/%d...", repo.OwnerID, repo.ID)
  1473. if err := git.InitRepository(repo.RepoPath(), true); err != nil {
  1474. if err2 := CreateRepositoryNotice(fmt.Sprintf("InitRepository [%d]: %v", repo.ID, err)); err2 != nil {
  1475. return fmt.Errorf("CreateRepositoryNotice: %v", err)
  1476. }
  1477. }
  1478. }
  1479. return nil
  1480. }
  1481. // RewriteRepositoryUpdateHook rewrites all repositories' update hook.
  1482. func RewriteRepositoryUpdateHook() error {
  1483. return x.Where("id > 0").Iterate(new(Repository),
  1484. func(idx int, bean interface{}) error {
  1485. repo := bean.(*Repository)
  1486. return createUpdateHook(repo.RepoPath())
  1487. })
  1488. }
  1489. // Prevent duplicate running tasks.
  1490. var taskStatusTable = sync.NewStatusTable()
  1491. const (
  1492. _MIRROR_UPDATE = "mirror_update"
  1493. _GIT_FSCK = "git_fsck"
  1494. _CHECK_REPOs = "check_repos"
  1495. )
  1496. // MirrorUpdate checks and updates mirror repositories.
  1497. func MirrorUpdate() {
  1498. if taskStatusTable.IsRunning(_MIRROR_UPDATE) {
  1499. return
  1500. }
  1501. taskStatusTable.Start(_MIRROR_UPDATE)
  1502. defer taskStatusTable.Stop(_MIRROR_UPDATE)
  1503. log.Trace("Doing: MirrorUpdate")
  1504. mirrors := make([]*Mirror, 0, 10)
  1505. if err := x.Where("next_update_unix<=?", time.Now().Unix()).Iterate(new(Mirror), func(idx int, bean interface{}) error {
  1506. m := bean.(*Mirror)
  1507. if m.Repo == nil {
  1508. log.Error(4, "Disconnected mirror repository found: %d", m.ID)
  1509. return nil
  1510. }
  1511. repoPath := m.Repo.RepoPath()
  1512. wikiPath := m.Repo.WikiPath()
  1513. timeout := time.Duration(setting.Git.Timeout.Mirror) * time.Second
  1514. gitArgs := []string{"remote", "update"}
  1515. if m.EnablePrune {
  1516. gitArgs = append(gitArgs, "--prune")
  1517. }
  1518. if _, stderr, err := process.ExecDir(
  1519. timeout, repoPath, fmt.Sprintf("MirrorUpdate: %s", repoPath),
  1520. "git", gitArgs...); err != nil {
  1521. desc := fmt.Sprintf("Fail to update mirror repository(%s): %s", repoPath, stderr)
  1522. log.Error(4, desc)
  1523. if err = CreateRepositoryNotice(desc); err != nil {
  1524. log.Error(4, "CreateRepositoryNotice: %v", err)
  1525. }
  1526. return nil
  1527. }
  1528. if m.Repo.HasWiki() {
  1529. if _, stderr, err := process.ExecDir(
  1530. timeout, wikiPath, fmt.Sprintf("MirrorUpdate: %s", wikiPath),
  1531. "git", "remote", "update", "--prune"); err != nil {
  1532. desc := fmt.Sprintf("Fail to update mirror wiki repository(%s): %s", wikiPath, stderr)
  1533. log.Error(4, desc)
  1534. if err = CreateRepositoryNotice(desc); err != nil {
  1535. log.Error(4, "CreateRepositoryNotice: %v", err)
  1536. }
  1537. return nil
  1538. }
  1539. }
  1540. m.NextUpdate = time.Now().Add(time.Duration(m.Interval) * time.Hour)
  1541. mirrors = append(mirrors, m)
  1542. return nil
  1543. }); err != nil {
  1544. log.Error(4, "MirrorUpdate: %v", err)
  1545. }
  1546. for i := range mirrors {
  1547. if err := UpdateMirror(mirrors[i]); err != nil {
  1548. log.Error(4, "UpdateMirror[%d]: %v", mirrors[i].ID, err)
  1549. }
  1550. }
  1551. }
  1552. // GitFsck calls 'git fsck' to check repository health.
  1553. func GitFsck() {
  1554. if taskStatusTable.IsRunning(_GIT_FSCK) {
  1555. return
  1556. }
  1557. taskStatusTable.Start(_GIT_FSCK)
  1558. defer taskStatusTable.Stop(_GIT_FSCK)
  1559. log.Trace("Doing: GitFsck")
  1560. if err := x.Where("id>0").Iterate(new(Repository),
  1561. func(idx int, bean interface{}) error {
  1562. repo := bean.(*Repository)
  1563. repoPath := repo.RepoPath()
  1564. if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil {
  1565. desc := fmt.Sprintf("Fail to health check repository (%s): %v", repoPath, err)
  1566. log.Warn(desc)
  1567. if err = CreateRepositoryNotice(desc); err != nil {
  1568. log.Error(4, "CreateRepositoryNotice: %v", err)
  1569. }
  1570. }
  1571. return nil
  1572. }); err != nil {
  1573. log.Error(4, "GitFsck: %v", err)
  1574. }
  1575. }
  1576. func GitGcRepos() error {
  1577. args := append([]string{"gc"}, setting.Git.GCArgs...)
  1578. return x.Where("id > 0").Iterate(new(Repository),
  1579. func(idx int, bean interface{}) error {
  1580. repo := bean.(*Repository)
  1581. if err := repo.GetOwner(); err != nil {
  1582. return err
  1583. }
  1584. _, stderr, err := process.ExecDir(
  1585. time.Duration(setting.Git.Timeout.GC)*time.Second,
  1586. RepoPath(repo.Owner.Name, repo.Name), "Repository garbage collection",
  1587. "git", args...)
  1588. if err != nil {
  1589. return fmt.Errorf("%v: %v", err, stderr)
  1590. }
  1591. return nil
  1592. })
  1593. }
  1594. type repoChecker struct {
  1595. querySQL, correctSQL string
  1596. desc string
  1597. }
  1598. func repoStatsCheck(checker *repoChecker) {
  1599. results, err := x.Query(checker.querySQL)
  1600. if err != nil {
  1601. log.Error(4, "Select %s: %v", checker.desc, err)
  1602. return
  1603. }
  1604. for _, result := range results {
  1605. id := com.StrTo(result["id"]).MustInt64()
  1606. log.Trace("Updating %s: %d", checker.desc, id)
  1607. _, err = x.Exec(checker.correctSQL, id, id)
  1608. if err != nil {
  1609. log.Error(4, "Update %s[%d]: %v", checker.desc, id, err)
  1610. }
  1611. }
  1612. }
  1613. func CheckRepoStats() {
  1614. if taskStatusTable.IsRunning(_CHECK_REPOs) {
  1615. return
  1616. }
  1617. taskStatusTable.Start(_CHECK_REPOs)
  1618. defer taskStatusTable.Stop(_CHECK_REPOs)
  1619. log.Trace("Doing: CheckRepoStats")
  1620. checkers := []*repoChecker{
  1621. // Repository.NumWatches
  1622. {
  1623. "SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id)",
  1624. "UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=?) WHERE id=?",
  1625. "repository count 'num_watches'",
  1626. },
  1627. // Repository.NumStars
  1628. {
  1629. "SELECT repo.id FROM `repository` repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM `star` WHERE repo_id=repo.id)",
  1630. "UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?",
  1631. "repository count 'num_stars'",
  1632. },
  1633. // Label.NumIssues
  1634. {
  1635. "SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id)",
  1636. "UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?",
  1637. "label count 'num_issues'",
  1638. },
  1639. // User.NumRepos
  1640. {
  1641. "SELECT `user`.id FROM `user` WHERE `user`.num_repos!=(SELECT COUNT(*) FROM `repository` WHERE owner_id=`user`.id)",
  1642. "UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?",
  1643. "user count 'num_repos'",
  1644. },
  1645. // Issue.NumComments
  1646. {
  1647. "SELECT `issue`.id FROM `issue` WHERE `issue`.num_comments!=(SELECT COUNT(*) FROM `comment` WHERE issue_id=`issue`.id AND type=0)",
  1648. "UPDATE `issue` SET num_comments=(SELECT COUNT(*) FROM `comment` WHERE issue_id=? AND type=0) WHERE id=?",
  1649. "issue count 'num_comments'",
  1650. },
  1651. }
  1652. for i := range checkers {
  1653. repoStatsCheck(checkers[i])
  1654. }
  1655. // ***** START: Repository.NumClosedIssues *****
  1656. desc := "repository count 'num_closed_issues'"
  1657. results, err := x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_closed_issues!=(SELECT COUNT(*) FROM `issue` WHERE repo_id=repo.id AND is_closed=? AND is_pull=?)", true, false)
  1658. if err != nil {
  1659. log.Error(4, "Select %s: %v", desc, err)
  1660. } else {
  1661. for _, result := range results {
  1662. id := com.StrTo(result["id"]).MustInt64()
  1663. log.Trace("Updating %s: %d", desc, id)
  1664. _, err = x.Exec("UPDATE `repository` SET num_closed_issues=(SELECT COUNT(*) FROM `issue` WHERE repo_id=? AND is_closed=? AND is_pull=?) WHERE id=?", id, true, false, id)
  1665. if err != nil {
  1666. log.Error(4, "Update %s[%d]: %v", desc, id, err)
  1667. }
  1668. }
  1669. }
  1670. // ***** END: Repository.NumClosedIssues *****
  1671. // FIXME: use checker when stop supporting old fork repo format.
  1672. // ***** START: Repository.NumForks *****
  1673. results, err = x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_forks!=(SELECT COUNT(*) FROM `repository` WHERE fork_id=repo.id)")
  1674. if err != nil {
  1675. log.Error(4, "Select repository count 'num_forks': %v", err)
  1676. } else {
  1677. for _, result := range results {
  1678. id := com.StrTo(result["id"]).MustInt64()
  1679. log.Trace("Updating repository count 'num_forks': %d", id)
  1680. repo, err := GetRepositoryByID(id)
  1681. if err != nil {
  1682. log.Error(4, "GetRepositoryByID[%d]: %v", id, err)
  1683. continue
  1684. }
  1685. rawResult, err := x.Query("SELECT COUNT(*) FROM `repository` WHERE fork_id=?", repo.ID)
  1686. if err != nil {
  1687. log.Error(4, "Select count of forks[%d]: %v", repo.ID, err)
  1688. continue
  1689. }
  1690. repo.NumForks = int(parseCountResult(rawResult))
  1691. if err = UpdateRepository(repo, false); err != nil {
  1692. log.Error(4, "UpdateRepository[%d]: %v", id, err)
  1693. continue
  1694. }
  1695. }
  1696. }
  1697. // ***** END: Repository.NumForks *****
  1698. }
  1699. type RepositoryList []*Repository
  1700. func (repos RepositoryList) loadAttributes(e Engine) error {
  1701. if len(repos) == 0 {
  1702. return nil
  1703. }
  1704. // Load owners.
  1705. set := make(map[int64]*User)
  1706. for i := range repos {
  1707. set[repos[i].OwnerID] = nil
  1708. }
  1709. userIDs := make([]int64, 0, len(set))
  1710. for userID := range set {
  1711. userIDs = append(userIDs, userID)
  1712. }
  1713. users := make([]*User, 0, len(userIDs))
  1714. if err := e.Where("id > 0").In("id", userIDs).Find(&users); err != nil {
  1715. return fmt.Errorf("find users: %v", err)
  1716. }
  1717. for i := range users {
  1718. set[users[i].ID] = users[i]
  1719. }
  1720. for i := range repos {
  1721. repos[i].Owner = set[repos[i].OwnerID]
  1722. }
  1723. return nil
  1724. }
  1725. func (repos RepositoryList) LoadAttributes() error {
  1726. return repos.loadAttributes(x)
  1727. }
  1728. type MirrorRepositoryList []*Repository
  1729. func (repos MirrorRepositoryList) loadAttributes(e Engine) error {
  1730. if len(repos) == 0 {
  1731. return nil
  1732. }
  1733. // Load mirrors.
  1734. repoIDs := make([]int64, 0, len(repos))
  1735. for i := range repos {
  1736. if !repos[i].IsMirror {
  1737. continue
  1738. }
  1739. repoIDs = append(repoIDs, repos[i].ID)
  1740. }
  1741. mirrors := make([]*Mirror, 0, len(repoIDs))
  1742. if err := e.Where("id > 0").In("repo_id", repoIDs).Find(&mirrors); err != nil {
  1743. return fmt.Errorf("find mirrors: %v", err)
  1744. }
  1745. set := make(map[int64]*Mirror)
  1746. for i := range mirrors {
  1747. set[mirrors[i].RepoID] = mirrors[i]
  1748. }
  1749. for i := range repos {
  1750. repos[i].Mirror = set[repos[i].ID]
  1751. }
  1752. return nil
  1753. }
  1754. func (repos MirrorRepositoryList) LoadAttributes() error {
  1755. return repos.loadAttributes(x)
  1756. }
  1757. // __ __ __ .__
  1758. // / \ / \_____ _/ |_ ____ | |__
  1759. // \ \/\/ /\__ \\ __\/ ___\| | \
  1760. // \ / / __ \| | \ \___| Y \
  1761. // \__/\ / (____ /__| \___ >___| /
  1762. // \/ \/ \/ \/
  1763. // Watch is connection request for receiving repository notification.
  1764. type Watch struct {
  1765. ID int64 `xorm:"pk autoincr"`
  1766. UserID int64 `xorm:"UNIQUE(watch)"`
  1767. RepoID int64 `xorm:"UNIQUE(watch)"`
  1768. }
  1769. func isWatching(e Engine, userID, repoID int64) bool {
  1770. has, _ := e.Get(&Watch{0, userID, repoID})
  1771. return has
  1772. }
  1773. // IsWatching checks if user has watched given repository.
  1774. func IsWatching(userID, repoID int64) bool {
  1775. return isWatching(x, userID, repoID)
  1776. }
  1777. func watchRepo(e Engine, userID, repoID int64, watch bool) (err error) {
  1778. if watch {
  1779. if isWatching(e, userID, repoID) {
  1780. return nil
  1781. }
  1782. if _, err = e.Insert(&Watch{RepoID: repoID, UserID: userID}); err != nil {
  1783. return err
  1784. }
  1785. _, err = e.Exec("UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ?", repoID)
  1786. } else {
  1787. if !isWatching(e, userID, repoID) {
  1788. return nil
  1789. }
  1790. if _, err = e.Delete(&Watch{0, userID, repoID}); err != nil {
  1791. return err
  1792. }
  1793. _, err = e.Exec("UPDATE `repository` SET num_watches = num_watches - 1 WHERE id = ?", repoID)
  1794. }
  1795. return err
  1796. }
  1797. // Watch or unwatch repository.
  1798. func WatchRepo(userID, repoID int64, watch bool) (err error) {
  1799. return watchRepo(x, userID, repoID, watch)
  1800. }
  1801. func getWatchers(e Engine, repoID int64) ([]*Watch, error) {
  1802. watches := make([]*Watch, 0, 10)
  1803. return watches, e.Find(&watches, &Watch{RepoID: repoID})
  1804. }
  1805. // GetWatchers returns all watchers of given repository.
  1806. func GetWatchers(repoID int64) ([]*Watch, error) {
  1807. return getWatchers(x, repoID)
  1808. }
  1809. // Repository.GetWatchers returns range of users watching given repository.
  1810. func (repo *Repository) GetWatchers(page int) ([]*User, error) {
  1811. users := make([]*User, 0, ItemsPerPage)
  1812. sess := x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).Where("watch.repo_id=?", repo.ID)
  1813. if setting.UsePostgreSQL {
  1814. sess = sess.Join("LEFT", "watch", `"user".id=watch.user_id`)
  1815. } else {
  1816. sess = sess.Join("LEFT", "watch", "user.id=watch.user_id")
  1817. }
  1818. return users, sess.Find(&users)
  1819. }
  1820. func notifyWatchers(e Engine, act *Action) error {
  1821. // Add feeds for user self and all watchers.
  1822. watches, err := getWatchers(e, act.RepoID)
  1823. if err != nil {
  1824. return fmt.Errorf("get watchers: %v", err)
  1825. }
  1826. // Add feed for actioner.
  1827. act.UserID = act.ActUserID
  1828. if _, err = e.InsertOne(act); err != nil {
  1829. return fmt.Errorf("insert new actioner: %v", err)
  1830. }
  1831. for i := range watches {
  1832. if act.ActUserID == watches[i].UserID {
  1833. continue
  1834. }
  1835. act.ID = 0
  1836. act.UserID = watches[i].UserID
  1837. if _, err = e.InsertOne(act); err != nil {
  1838. return fmt.Errorf("insert new action: %v", err)
  1839. }
  1840. }
  1841. return nil
  1842. }
  1843. // NotifyWatchers creates batch of actions for every watcher.
  1844. func NotifyWatchers(act *Action) error {
  1845. return notifyWatchers(x, act)
  1846. }
  1847. // _________ __
  1848. // / _____// |______ _______
  1849. // \_____ \\ __\__ \\_ __ \
  1850. // / \| | / __ \| | \/
  1851. // /_______ /|__| (____ /__|
  1852. // \/ \/
  1853. type Star struct {
  1854. ID int64 `xorm:"pk autoincr"`
  1855. UID int64 `xorm:"UNIQUE(s)"`
  1856. RepoID int64 `xorm:"UNIQUE(s)"`
  1857. }
  1858. // Star or unstar repository.
  1859. func StarRepo(userID, repoID int64, star bool) (err error) {
  1860. if star {
  1861. if IsStaring(userID, repoID) {
  1862. return nil
  1863. }
  1864. if _, err = x.Insert(&Star{UID: userID, RepoID: repoID}); err != nil {
  1865. return err
  1866. } else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars + 1 WHERE id = ?", repoID); err != nil {
  1867. return err
  1868. }
  1869. _, err = x.Exec("UPDATE `user` SET num_stars = num_stars + 1 WHERE id = ?", userID)
  1870. } else {
  1871. if !IsStaring(userID, repoID) {
  1872. return nil
  1873. }
  1874. if _, err = x.Delete(&Star{0, userID, repoID}); err != nil {
  1875. return err
  1876. } else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars - 1 WHERE id = ?", repoID); err != nil {
  1877. return err
  1878. }
  1879. _, err = x.Exec("UPDATE `user` SET num_stars = num_stars - 1 WHERE id = ?", userID)
  1880. }
  1881. return err
  1882. }
  1883. // IsStaring checks if user has starred given repository.
  1884. func IsStaring(userID, repoID int64) bool {
  1885. has, _ := x.Get(&Star{0, userID, repoID})
  1886. return has
  1887. }
  1888. func (repo *Repository) GetStargazers(page int) ([]*User, error) {
  1889. users := make([]*User, 0, ItemsPerPage)
  1890. sess := x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).Where("star.repo_id=?", repo.ID)
  1891. if setting.UsePostgreSQL {
  1892. sess = sess.Join("LEFT", "star", `"user".id=star.uid`)
  1893. } else {
  1894. sess = sess.Join("LEFT", "star", "user.id=star.uid")
  1895. }
  1896. return users, sess.Find(&users)
  1897. }
  1898. // ___________ __
  1899. // \_ _____/__________| | __
  1900. // | __)/ _ \_ __ \ |/ /
  1901. // | \( <_> ) | \/ <
  1902. // \___ / \____/|__| |__|_ \
  1903. // \/ \/
  1904. // HasForkedRepo checks if given user has already forked a repository with given ID.
  1905. func HasForkedRepo(ownerID, repoID int64) (*Repository, bool) {
  1906. repo := new(Repository)
  1907. has, _ := x.Where("owner_id=? AND fork_id=?", ownerID, repoID).Get(repo)
  1908. return repo, has
  1909. }
  1910. func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Repository, err error) {
  1911. repo := &Repository{
  1912. OwnerID: u.ID,
  1913. Owner: u,
  1914. Name: name,
  1915. LowerName: strings.ToLower(name),
  1916. Description: desc,
  1917. DefaultBranch: oldRepo.DefaultBranch,
  1918. IsPrivate: oldRepo.IsPrivate,
  1919. IsFork: true,
  1920. ForkID: oldRepo.ID,
  1921. }
  1922. sess := x.NewSession()
  1923. defer sessionRelease(sess)
  1924. if err = sess.Begin(); err != nil {
  1925. return nil, err
  1926. }
  1927. if err = createRepository(sess, u, repo); err != nil {
  1928. return nil, err
  1929. }
  1930. if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks+1 WHERE id=?", oldRepo.ID); err != nil {
  1931. return nil, err
  1932. }
  1933. repoPath := RepoPath(u.Name, repo.Name)
  1934. _, stderr, err := process.ExecTimeout(10*time.Minute,
  1935. fmt.Sprintf("ForkRepository(git clone): %s/%s", u.Name, repo.Name),
  1936. "git", "clone", "--bare", oldRepo.RepoPath(), repoPath)
  1937. if err != nil {
  1938. return nil, fmt.Errorf("git clone: %v", stderr)
  1939. }
  1940. _, stderr, err = process.ExecDir(-1,
  1941. repoPath, fmt.Sprintf("ForkRepository(git update-server-info): %s", repoPath),
  1942. "git", "update-server-info")
  1943. if err != nil {
  1944. return nil, fmt.Errorf("git update-server-info: %v", err)
  1945. }
  1946. if err = createUpdateHook(repoPath); err != nil {
  1947. return nil, fmt.Errorf("createUpdateHook: %v", err)
  1948. }
  1949. return repo, sess.Commit()
  1950. }
  1951. func (repo *Repository) GetForks() ([]*Repository, error) {
  1952. forks := make([]*Repository, 0, repo.NumForks)
  1953. return forks, x.Find(&forks, &Repository{ForkID: repo.ID})
  1954. }
  1955. // ____ ___ .__ .___ ___________.___.__
  1956. // | | \______ | | _________ __| _/ \_ _____/| | | ____ ______
  1957. // | | /\____ \| | / _ \__ \ / __ | | __) | | | _/ __ \ / ___/
  1958. // | | / | |_> > |_( <_> ) __ \_/ /_/ | | \ | | |_\ ___/ \___ \
  1959. // |______/ | __/|____/\____(____ /\____ | \___ / |___|____/\___ >____ >
  1960. // |__| \/ \/ \/ \/ \/
  1961. //
  1962. // uploadRepoFiles uploads new files to repository.
  1963. func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treePath, message string, uuids []string) (err error) {
  1964. repoWorkingPool.CheckIn(com.ToStr(repo.ID))
  1965. defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
  1966. localPath := repo.LocalCopyPath()
  1967. if err = discardLocalRepoBranchChanges(localPath, oldBranchName); err != nil {
  1968. return fmt.Errorf("discardLocalRepoChanges: %v", err)
  1969. } else if err = repo.UpdateLocalCopyBranch(oldBranchName); err != nil {
  1970. return fmt.Errorf("UpdateLocalCopyBranch: %v", err)
  1971. }
  1972. if oldBranchName != branchName {
  1973. repo.CheckoutNewBranch(oldBranchName, branchName)
  1974. }
  1975. dirPath := path.Join(localPath, treePath)
  1976. os.MkdirAll(dirPath, os.ModePerm)
  1977. // Copy uploaded files into repository.
  1978. for _, uuid := range uuids {
  1979. upload, err := getUpload(uuid, doer.ID, repo.ID)
  1980. if err != nil {
  1981. if IsErrUploadNotExist(err) {
  1982. continue
  1983. }
  1984. return fmt.Errorf("getUpload[%s]: %v", uuid, err)
  1985. }
  1986. uuidPath := upload.LocalPath()
  1987. filePath := dirPath + "/" + upload.Name
  1988. if err := os.Rename(uuidPath, filePath); err != nil {
  1989. DeleteUpload(upload, true)
  1990. return fmt.Errorf("Rename[%s -> %s]: %v", uuidPath, filePath, err)
  1991. }
  1992. DeleteUpload(upload, false) // false because we have moved the file
  1993. }
  1994. if len(message) == 0 {
  1995. message = "Add files to '" + treePath + "'"
  1996. }
  1997. if err = git.AddChanges(localPath, true); err != nil {
  1998. return fmt.Errorf("AddChanges: %v", err)
  1999. } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{
  2000. Committer: doer.NewGitSig(),
  2001. Message: message,
  2002. }); err != nil {
  2003. return fmt.Errorf("CommitChanges: %v", err)
  2004. } else if err = git.Push(localPath, "origin", branchName); err != nil {
  2005. return fmt.Errorf("Push: %v", err)
  2006. }
  2007. return nil
  2008. }
  2009. // Upload represent a uploaded file to a repo to be deleted when moved
  2010. type Upload struct {
  2011. ID int64 `xorm:"pk autoincr"`
  2012. UUID string `xorm:"uuid UNIQUE"`
  2013. UID int64 `xorm:"INDEX"`
  2014. RepoID int64 `xorm:"INDEX"`
  2015. Name string
  2016. Created time.Time `xorm:"-"`
  2017. CreatedUnix int64
  2018. }
  2019. func (u *Upload) BeforeInsert() {
  2020. u.CreatedUnix = time.Now().UTC().Unix()
  2021. }
  2022. func (u *Upload) AfterSet(colName string, _ xorm.Cell) {
  2023. switch colName {
  2024. case "created_unix":
  2025. u.Created = time.Unix(u.CreatedUnix, 0).Local()
  2026. }
  2027. }
  2028. // UploadLocalPath returns where uploads is stored in local file system based on given UUID.
  2029. func UploadLocalPath(uuid string) string {
  2030. return path.Join(setting.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
  2031. }
  2032. // LocalPath returns where uploads are temporarily stored in local file system.
  2033. func (upload *Upload) LocalPath() string {
  2034. return UploadLocalPath(upload.UUID)
  2035. }
  2036. // NewUpload creates a new upload object.
  2037. func NewUpload(name string, buf []byte, file multipart.File, userId, repoId int64) (_ *Upload, err error) {
  2038. up := &Upload{
  2039. UUID: gouuid.NewV4().String(),
  2040. Name: name,
  2041. UID: userId,
  2042. RepoID: repoId,
  2043. }
  2044. if err = os.MkdirAll(path.Dir(up.LocalPath()), os.ModePerm); err != nil {
  2045. return nil, fmt.Errorf("MkdirAll: %v", err)
  2046. }
  2047. fw, err := os.Create(up.LocalPath())
  2048. if err != nil {
  2049. return nil, fmt.Errorf("Create: %v", err)
  2050. }
  2051. defer fw.Close()
  2052. if _, err = fw.Write(buf); err != nil {
  2053. return nil, fmt.Errorf("Write: %v", err)
  2054. } else if _, err = io.Copy(fw, file); err != nil {
  2055. return nil, fmt.Errorf("Copy: %v", err)
  2056. }
  2057. sess := x.NewSession()
  2058. defer sessionRelease(sess)
  2059. if err := sess.Begin(); err != nil {
  2060. return nil, err
  2061. }
  2062. if _, err := sess.Insert(up); err != nil {
  2063. return nil, err
  2064. }
  2065. return up, sess.Commit()
  2066. }
  2067. // RemoveUpload removes the file by UUID
  2068. func RemoveUpload(uuid string, userId, repoId int64) (err error) {
  2069. sess := x.NewSession()
  2070. defer sessionRelease(sess)
  2071. if err := sess.Begin(); err != nil {
  2072. return err
  2073. }
  2074. upload, err := getUpload(uuid, userId, repoId)
  2075. if err != nil {
  2076. return fmt.Errorf("getUpload[%s]: %v", uuid, err)
  2077. }
  2078. if err := DeleteUpload(upload, true); err != nil {
  2079. return fmt.Errorf("DeleteUpload[%s]: %v", uuid, err)
  2080. }
  2081. return nil
  2082. }
  2083. func getUpload(uuid string, userID, repoID int64) (*Upload, error) {
  2084. up := &Upload{UUID: uuid, UID: userID, RepoID: repoID}
  2085. has, err := x.Get(up)
  2086. if err != nil {
  2087. return nil, err
  2088. } else if !has {
  2089. return nil, ErrUploadNotExist{0, uuid, userID, repoID}
  2090. }
  2091. return up, nil
  2092. }
  2093. // GetUpload returns Upload by given UUID.
  2094. func GetUpload(uuid string, userId, repoId int64) (*Upload, error) {
  2095. return getUpload(uuid, userId, repoId)
  2096. }
  2097. // DeleteUpload deletes the given upload
  2098. func DeleteUpload(u *Upload, remove bool) error {
  2099. _, err := DeleteUploads([]*Upload{u}, remove)
  2100. return err
  2101. }
  2102. // DeleteUploads deletes the given uploads
  2103. func DeleteUploads(uploads []*Upload, remove bool) (int, error) {
  2104. for i, u := range uploads {
  2105. if remove {
  2106. if err := os.Remove(u.LocalPath()); err != nil {
  2107. return i, err
  2108. }
  2109. }
  2110. if _, err := x.Delete(u); err != nil {
  2111. return i, err
  2112. }
  2113. }
  2114. return len(uploads), nil
  2115. }
  2116. // __________ .__
  2117. // \______ \____________ ____ ____ | |__
  2118. // | | _/\_ __ \__ \ / \_/ ___\| | \
  2119. // | | \ | | \// __ \| | \ \___| Y \
  2120. // |______ / |__| (____ /___| /\___ >___| /
  2121. // \/ \/ \/ \/ \/
  2122. //
  2123. func (repo *Repository) CreateNewBranch(doer *User, oldBranchName, branchName string) (err error) {
  2124. repoWorkingPool.CheckIn(com.ToStr(repo.ID))
  2125. defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
  2126. localPath := repo.LocalCopyPath()
  2127. if err = discardLocalRepoBranchChanges(localPath, oldBranchName); err != nil {
  2128. return fmt.Errorf("discardLocalRepoChanges: %v", err)
  2129. } else if err = repo.UpdateLocalCopyBranch(oldBranchName); err != nil {
  2130. return fmt.Errorf("UpdateLocalCopyBranch: %v", err)
  2131. }
  2132. if err = repo.CheckoutNewBranch(oldBranchName, branchName); err != nil {
  2133. return fmt.Errorf("CreateNewBranch: %v", err)
  2134. }
  2135. if err = git.Push(localPath, "origin", branchName); err != nil {
  2136. return fmt.Errorf("Push: %v", err)
  2137. }
  2138. return nil
  2139. }